Select from following answers:- 1024
- 249
- 32
- 10
- All Above
SQL Server allows for only 10 levels of nesting in CASE expressions.
ie:
DECLARE @A TINYINT
SELECT @A = 10
SELECT CASE WHEN @A>0 THEN
(CASE WHEN @A>1 THEN
(CASE WHEN @A>2 THEN
(CASE WHEN @A>3 THEN
(CASE WHEN @A>4 THEN
(CASE WHEN @A>5 THEN
(CASE WHEN @A>6 THEN
(CASE WHEN @A>7 THEN
(CASE WHEN @A>8 THEN
(CASE WHEN @A>9 THEN
(CASE WHEN @A=10 THEN
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END)
ELSE 'END' END
Err:
--------
Msg 125, Level 15, State 4, Line 13
Case expressions may only be nested to level 10.
Show Correct Answer
Asked In: General |
Alert Moderator