The topic describes the DF032 T-SQL code analysis rule.
BEST PRACTICE
A control-of-flow statement is not defined by using a statement block.
It is recommended to use the BEGIN…END keywords to enclose control-of-flow statements into a statement block.
The nested IF-ELSE clause doesn’t need to be enclosed by the BEGIN and END keywords. However, the IF clause must be wrapped by the BEGIN and END keywords.
IF @Var1=1 SELECT '1' AS Result ELSE SELECT '2' AS Result
IF @Var1=1 BEGIN
SELECT '1' AS Result
END ELSE BEGIN
SELECT '2' AS Result
END