I want to loop through a small piece of code for each parameter @p1 to @pn passed into my stored procedure. Is there a way I refer to the parameters indirectly? e.g. in a local variable which will change on each loop iteration?
You can create a temp table, insert all the parameters into it then loop through that - create an identity on the temp table and use that to loop through the rows.
======================================
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.