Flow Control

Learn to use flow control with conditional logic in T-SQL queries.

T-SQL can be considered a programming language because we can add conditional logic to our T-SQL queries. In other words, T-SQL supports the IFELSE construct, like the majority of procedural programming languages.

Syntax

The IFELSE construct has this syntax in T-SQL:

 ...