Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

precedence constraint question

Status
Not open for further replies.

rq

Programmer
Jun 13, 2002
56
0
0
US

In the DTS package I created, there exists a Transform Data task wherein a newly created SQL table is populated with data. Whenever this task is executed, results vary for this Transform Data task -- that means this newly created table could have several records at times or none at all. An Execute SQL task follows the Transform Data task. Is it possible to define a precedence contraint wherein the Transform Data task will execute ONLY if several new records where populated onto the newly created SQL table? I am aware of the Workflow property and how you can execute the succeeding task on success, failure or unconditionally.

 
Nope. What you can do it after the data is loaded check the table for data. If there is none, raise an error which will stop the package. If there is data do not raise the error and let the package continue.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
What task do you use to raise an error so that I can check the table for data?
 
This should do the trick.
Code:
if not exists (select * from table)
   raiserror ('There was no data in the table', 16, 1)

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top