I understand that the below fragment will return a separate 1-row results set for each successful loop (also unnecessarily repeating the column header each time). How can I alter my procedure so that each value returned by the loop is appended
underneath the previous value as multiple rows of a single results set? Do I have to store each return value in a temp table or someother storage object? It would be nice to just be able to spit them out row by row as each loop returned. Possible? Easy? Hard?
I really appreciate the help I've received here so far.
DECLARE techCursor CURSOR
FETCH NEXT FROM techCursor INTO @techNumLoop;
WHILE @@FETCH_STATUS = 0
EXECUTE pr_FindExpenses4Tech @techNumLoop, @itemCount OUTPUT
SELECT @itemCount Item_Count
View Complete Post