Loop Through a Table without Cursor - MSSQL

Loop Through a Table without Cursor - MSSQL

code snippet

mssql
DECLARE @Variable AS INT 
WHILE (Select Count(*) From @Temp) > 0
BEGIN
SELECT Top 1 @Variable = Columnname From @Temp

-- Do stuff

DELETE FROM @Temp WHERE Columnname = @Variable
END

"The measure of who we are is what we do with what we have"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.