RosettaCodeData/Task/Conditional-structures/SQL/conditional-structures-2.sql

10 lines
188 B
Transact-SQL

declare @n int
set @n=123
if @n=123
BEGIN --begin/end needed if more than one statement inside
print 'one two three'
END
ELSE
if @n=124 print 'one two four'
else print 'other'