Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Excute DTS based on db lookup

Author  Topic 

dc13859
Starting Member

3 Posts

Posted - 2007-12-18 : 12:43:34
Hi,

I have a DTS package which nightly emails out the results of a db query in a flat file.

I need to be able to stop the email going out if the db query produces no results.

In other words, if a select count(*) = 0 then quit DTS.

Any idea how I can do this? I'm thinking that I need to create a global variable based on the query count and then use a VB script to look at the value and exit if required.

Any assistance would be greatly appreciated.

Rgd's,

Dave

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-18 : 22:31:34
There are workflows in dts package.
Go to Top of Page

dc13859
Starting Member

3 Posts

Posted - 2007-12-19 : 06:08:06
The workflow process, as I understand it, allows the DTS package to directed based on the success or failure of a specified previous step. I'm not sure though how the result of a db query can by identified as a success or failure. If Select Count(*) from tablename = 0 how can I flag that SQL query step as having failed for the benefit of the subsequent step(s)?

Tks, Dave
Go to Top of Page
   

- Advertisement -