The IF statement is used to test for a condition. ... ELSE. SQL Server 2008 R2 ... When the IF statement evaluates to TRUE, the statement or block of statements ...
technet.microsoft.com