Iterating through a record set to run SP
Posted on 2014-01-19
I should probably know this but I don't.
I have a records set, let's keep it simple
Select email_address from contacts where email_address is not null
It returns a list of rows. duh.
Now, I want to iterate through the records set and do some for each.
Exec sp_do_something 'email_address"
What is the proper syntax to do this in MSSQL (replace the start loop and end loop.