Skip to main content
1 of 2

The best bet is to do it with a static Insert Statement if you really want to do it via a loop you could use the value of @I to determine which value to pass into the insert statement using a case statement would be the best route for that

I.E. While (@I <= 4) Begin Insert Into #Temp Select case @I when 1 then @1 when 2 then @2 ect End
SET @I +=1 end