I run a query select @id=table.id from table
and I need to loop over the results so I can exec a store procedure for each row exec stored_proc @varName=@id,@otherVarName='test'
How can I do this in a T-SQL script?
See Question&Answers more detail:os