SQL Packages
-
Hi Everyone Im a Beginner in using DTS i want to make a package in SQL Server That execute an sql query: - If this query returns rows, i want to take the first field for every row and give it to a second job that execute another query using this field in a loop until the number of fields ends - And if this query doesent return any rows, i want to skip the others steps that follow it How Can I Do It????????:confused:
-
Hi Everyone Im a Beginner in using DTS i want to make a package in SQL Server That execute an sql query: - If this query returns rows, i want to take the first field for every row and give it to a second job that execute another query using this field in a loop until the number of fields ends - And if this query doesent return any rows, i want to skip the others steps that follow it How Can I Do It????????:confused:
Hi Maro, I came across an article today that might help you get started. http://www.sqlteam.com/item.asp?ItemID=6881 The article was actually about trapping errors, but there are a couple of lines that may point you in the right direction: Basically, try this: declare @RC int set @rc = 0 select Column1 from Table1 select @RC = @@ROWCOUNT if @RC > 0 begin {do the second job} end I realize this doesn't solve your entire problem, but I hope it at least points you in the right direction. -DPR