Result set of a execute sql task as parameter of another execute sql task ?
Hi, Im having some problems over here. I want to use the result set (Full set stored as an Object) of an Execute Sql Task as input parameter of another Execute Sql Parameter. I want to do some insertions on the second task with the result table of the first one. Is this even possible ? Or do I have to use a foreach loop or a script task ? Thanks !
April 14th, 2011 8:08pm

Use for each loop.Nitesh Rai- Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
April 14th, 2011 8:51pm

in addition to what Nitesh said, set enumerator in foreach loop as ADO Enumerator and in the variable mappings tab of foreach loop editor, set another variable with index appropriate ( the index in number of column starting from 0, based on what columns you inserted into the object variable in previous execute sql task )http://www.rad.pasfu.com
April 15th, 2011 1:59am

When you want to perform inserts from the result set of one table to another table, what is that cannot be done by the data flow task?Request to please mark my post as an answer if I helped you to resolve the issue or vote up if I helped you.Thanks. Regards and good Wishes, Deepak.
Free Windows Admin Tool Kit Click here and download it now
April 15th, 2011 6:39am

thanks for the replies, the thing is that I dont know if passing a result set from an "Execute SQL Task" stored as an object to another "Execute SQL Task" to do some inserts, because I was looking to an alternative to the foreach loop. But if there is no way to go around that, than foreach loop will be. Thanks
April 15th, 2011 10:20am

Are your source and target different between these two Execute SQL Tasks? If not you may get away with a temp table and it will be a SQL only approach. If not you can dump the data to a file and load into the other database table to further consume. In both cases you can get away from the ForEach Loop (which can be a slower approach to process huge amount of data), besides, by going the SQL only way you avoid consuming too much memory and the process is going to be faster because there will be no dataset object involved.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
April 15th, 2011 10:28am

its actually a really really small table, so I guess the foreach is really the way to go. thanks everyone for the replies, you've helped me a lot. Thanks !!!
April 15th, 2011 11:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics