TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Use While LOOP in SQL
Ashish Srivastava
May 31
2016
Code
861
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
DECLARE
@TOTALV
BIGINT
DECLARE
@InitialValue
BIGINT
SET
@InitialValue=1
SET
@TOTALV=12
WHILE (@InitialValue<=@TOTALV)
BEGIN
print @InitialValue
SET
@InitialValue=@InitialValue+1
END
SQL
LOOP