SQL Server Performance Forum – Threads Archive
Check query contents to stop DTS package
This may be pretty basic, but I’m struggling with the answer. Basically, I need to run a query. If I get records in the query, I need to NOT run the rest of the DTS package. If I don’t get any records in the query, I DO need to run the rest of the package. I am not good with ActiveX, and haven’t found any examples that test for a recordset. Thanks for you help. MikeIf you had a T-SQL script, you could use this syntax …<br /><br />IF NOT EXISTS (<query_with_criteria><img src=’/community/emoticons/emotion-5.gif’ alt=’

quote:Originally posted by mkloster
This may be pretty basic, but I’m struggling with the answer.
Basically, I need to run a query. If I get records in the query, I need to NOT run the rest of the DTS package. If I don’t get any records in the query, I DO need to run the rest of the package. I am not good with ActiveX, and haven’t found any examples that test for a recordset. Thanks for you help.
Mike
If you are trying to implement it in activex script, then you need to google for such relevant articles about using ado objects.
for now, just consider this:
1>IN activex open connection with server, and fire ur t-sql or sp and while executing you can even get the no of records returned.
2>Based on that you can decide on further execution of your script
]]>