Establishing Flow Control
Probably the most powerful set of Transact-SQL features involves its capability to control program flow. Flow control is the ability that you have as a programmer to control each step your program takes in processing data. If you have programmed with other popular languages such as C, COBOL, Pascal, and Visual Basic, you are probably already familiar with control commands such as IF...THEN statements and with loops, which enable you to force a series of statements to be executed based on certain criteria that you define within the program. This section contains some of the major commands that allow you to enforce program flow control.
BEGIN and END Statements
Transact-SQL uses the BEGIN and END statements to signify ...