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
 General SQL Server Forums
 New to SQL Server Programming
 input result set to stored procedure

Author  Topic 

thbaig1
Starting Member

8 Posts

Posted - 2011-10-27 : 14:13:31
Hi,
RDBMS : MSSQL 2005

I have a requirement to take input a result set and then process insert in table whatever (all rows) in result set.

I want to know ,is it possible to take result set as input and process insert one by one?

Is this a good practice to take result set as input and process insert in a sp with loop traversing or application may call sp for single value insert recursively ?

X002548
Not Just a Number

15586 Posts

Posted - 2011-10-27 : 14:28:04
No it is not.

Insert the results to a temp or stage table

Then apply SQL Set based DML Operations against it

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -