Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I was wondering if it was possible to feed the results of a query into a stored procedure. pseudocode
1. select param1, param2, param3 from table2. for each row, exec sp_mystoreprocedure param1, param2, param3
I suspect it's do-able using cursors, but I haven't really figured out how cursors are done-- and if I understand correctly, they're really to be avoided as much as possible.
spirit1
Cybernetic Yak Master
11752 Posts
Posted - 2004-12-17 : 05:36:09
you can't execute an sproc for each line in resultset.you can do this with a user defined function. if you're not changing the db structure in your sproc use UDF.Go with the flow & have fun! Else fight the flow