Select from following answers:- 12
- 11
- 15
- 10

- All Above
It is 10. The below program will prove this
Declare @x int = 1
Select
case when @x <= 11 then
case when @x <= 10 then
case when @x <= 9 then
case when @x <= 8 then
case when @x <= 7 then
case when @x <= 5 then
case when @x <= 4 then
case when @x <= 3 then
case when @x <= 2 then
case when @x<= 1 then
case when @x <= 0 then
10
End End End End End End End End End End
End as "Case Density"
Msg 125, Level 15, State 4, Line 14
Case expressions may only be nested to level 10.
The SQL Server throws an error message stating that Case expressions may only be nested to level 10.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator