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)
 Dynamic Update in Execute SQL Task

Author  Topic 

rzelinsky
Starting Member

3 Posts

Posted - 2004-02-16 : 15:10:25
Hi,

I have a DTS package in which I am trying to do a SQL update statement within a loop that is moving through a resultset and dynamic building the SQL. The SQL is being built fine (a message box verifies it) now I want it to execute after each loop. How do I do this?

mr_mist
Grunnio

1870 Posts

Posted - 2004-02-17 : 03:19:23
What are you trying to do with the loop?

Why do you need the loop?

-------
Moo. :)
Go to Top of Page

rzelinsky
Starting Member

3 Posts

Posted - 2004-02-17 : 09:20:22
The loop exists for a resultset of update statements that I build from a table then need to execute against other tables. I am moving through the resultset and want to execute a update query then move to the next row and execute a different update query. Is there anyway to do an execute of a query inside my loop?

quote:
Originally posted by mr_mist

What are you trying to do with the loop?

Why do you need the loop?

-------
Moo. :)

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-02-17 : 10:05:44
see
See
http://www.nigelrivett.net/DTSExecuteStoredProcedure.html

It's for executing an SP but you can use a similar method for text.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

rzelinsky
Starting Member

3 Posts

Posted - 2004-02-17 : 14:28:59
Thanks for your help, that worked perfectly!
Go to Top of Page
   

- Advertisement -