How to traverse a SELECT rows in a STORED PROCEDURE in SQL Server?

2

Without using CURSOR and WHILE in SQL Server , what other ways would you be able to traverse the result lines of a SELECT to a STORED PROCEDURE ?

    
asked by anonymous 13.02.2016 / 09:11

1 answer

5

By taking CURSOR and WHILE I do not believe there is any other way.

In Oracle, we have a % with% loop , but this does not exist in SQL Server. But I do not see the real need to have even more ways to iterate a FOR beyond these two cases.

Iterate the results, even if using SELECT , I no longer think a good idea because it is not performative, imagine a CURSOR or any other loop.

    
13.02.2016 / 11:29