I have a very simple question regarding the SQL Server store procedure syntax.
I have a query that returns a set of data:
select myfield from mytable.
I want to execute that query and loop through the data set.
It fails obviously, because I expect over 100s of rows.
Could you post an example hot to accept a data set and loop through it ?