The text of this article is not in this database — only its details are. Read it on the old site: Importance of While Loop and Table Variable in SQL Server
10 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

Rakesh SPosted Sep 22, 2017, 7:22 AM
Hi, I have requirement that for each row i need to add some number like 100 to 5 rows and next 5 rows will start with first row number + addition of some number.
lakshmi prasannaPosted Jul 6, 2017, 8:53 AM
I have used while loop in a proc. while executing in sql management studio i am getting records like as you getting. In front end through entityframework i am trying to execute but it is returning only first record.
Ritu ChauhanPosted May 5, 2016, 9:54 AM
is there a way to print result set in a single table? I have used while loop to iterate through a table using dynamic sql, but haven't found a way to print the results in a single table
Manish SinghPosted Mar 17, 2012, 12:17 AM
It's a good job and it's a really help for beginners.
Amit MaheshwariPosted Mar 17, 2012, 12:06 AM
It's a good effort to accomplish such task have a great concept, So keep it up and thanks for sharing.......
Sudhakar ChaudharyPosted Mar 16, 2012, 3:22 PM
are you have any idea to get the index of any item from table without declare auto increment field???