Causes an exit from a while loop. break is often activated by an if test.
while logical_expression statement break statement continue
while (select avg (price) from titles) < $30 begin update titles set price = price * 2 select max (price) from titles if (select max (price) from titles) > $50 break else continue end begin print "Too much for the market to bear" end
break causes an exit from a while loop. Statements that appear after the keyword end, which marks the end of the loop, are then executed.
If two or more while loops are nested, the inner break exits to the next outermost loop. First, all the statements after the end of the inner loop run; then, the next outermost loop restarts.
ANSI SQL – Compliance level: Transact-SQL extension.
No permission is required to use break.