ELSE (IF...ELSE)
alternate branch
What changes
- Input
- boolean condition
- Output or change
- none
- Return type
- Boolean
Syntax at a glance
IF boolean_expression { sql_statement | statement_block } [ ELSE { sql_statement | statement_block } ]
Work example
A controlled task needs the behavior documented for ELSE (IF...ELSE) before it is added to a batch.
Read the linked Microsoft syntax and test ELSE (IF...ELSE) with synthetic input in an isolated database. Record its scope, permissions, and error path.
Check your work ELSE (IF...ELSE). The observed ELSE (IF...ELSE) behavior matches its written purpose and the test has no effect on permanent data or credentials.
Open Microsoft Learn for full syntax, permissions, and details for your version.