O'Reilly logo

SQL Server 2014 Development Essentials by Basit A. Masood-Al-Farooq

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Control-of-flow keywords

Control-of-flow keywords help SQL Server determine when and how Transact-SQL statements should execute. With these keywords, you can add logic around and within Transact-SQL statements to control program execution. Control-of-flow keywords add greater flexibility in OLTP application design and help you write clever code. Control-of-flow keywords include BEGIN…END, IF…ELSE, CASE, WHILE, BREAK, CONTINUE, RETURN, GOTO, and WAITFOR.

BEGIN…END keywords

The BEGIN…END keywords identify a code block. We typically use them to group Transact-SQL statements. The BEGIN…END blocks can be nested. We also use BEGIN…END statements to identify a code block in an IF…ELSE clause, WHILE loop, and CASE element. The following is the basic syntax ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required