WHILE statement sets a condition for the repeated execution of an SQL statement or statement block. Following is very simple example of WHILE Loop with BREAK and CONTINUE.
USE AdventureWorks; GO DECLARE @Flag INT SET @Flag=1 WHILE (@Flag<10) BEGIN BEGIN PRINT @Flag SET @Flag=@Flag+1 END IF(@Flag>5) BREAK ELSE CONTINUE END
edit | flag
Gokul A Answered on: Jun 28, 2011 at 1:09AM
Post your Answer
Welcome to Ask Amoeba! This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions. Learners, beginners, Experts stop and share your knowledge and ideas!