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)
 DTS - Execute Stored Proc?

Author  Topic 

seldenm
Starting Member

5 Posts

Posted - 2009-05-07 : 16:34:55
I have a query that generates a bunch of rows of data. I want to pass those values to a stored proc, once for each row.

I created 2 SQL tasks on the DTS. The first one has the query, defines global variables, and assigns the query output to the global variables. This query returns 225,000 rows.

Then I created another SQL task with the stored proc, and bound the global variables to the input parameters for the proc.

When I execute the package, the first task gets all 225,000 rows, but the stored procedure is only called once.

What am I doing wrong, and how do I set up this type of work flow with a DTS packate?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-05-08 : 01:37:58
Seems like you have to get a loop through the recordset.
Look here for approach:

Global Variables and Stored Procedure Parameters
http://www.sqldts.com/234.aspx

How to loop through a global variable Rowset
http://www.sqldts.com/298.aspx

Looping, Importing and Archiving
http://www.sqldts.com/246.aspx

Greetings
Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -