|
Transact-SQL User's Guide
|
Control-of-flow language
Transact-SQL
provides control-of-flow language that can be used as part of any
SQL statement or batch. These constructs are available: begin...end, break, continue, declare, goto
label, if...else, print, raiserror, return, waitfor, and while.
Local variables can be defined with declare and
assigned values. A number of predefined global variables are supplied
by the system.
Transact-SQL also supports case expressions,
which include the keywords case, when, then, coalesce,
and nullif. case expressions
replace the if statements of standard SQL. case expressions
are allowed anywhere a value expression is used.