Microsoft SQL Server IF...ELSE Single IF statement

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Like most of the other programming languages, T-SQL also supports IF..ELSE statements.

For example in the example below 1 = 1 is the expression, which evaluates to True and the control enters the BEGIN..END block and the Print statement prints the string 'One is equal to One'

IF ( 1 = 1)  --<-- Some Expression 
 BEGIN
   PRINT 'One is equal to One'
 END


Got any Microsoft SQL Server Question?