October 14, 2008 at 2:26 pm
What is te maximum allowed nested "If" statements?
What is the Maximum allowed "CASE" in "Select CASE" statement.
I ask because I was using the MS SQL Server Migration Assistant an on one SP, I got the error saying...
"Errors: Some part of your SQL statement is nested too deeply."
Thanks
October 15, 2008 at 6:34 am
It's 10 levels in a CASE statement (here's the page in the local Books Online). I don't know of a limit on IF statements, but I think it's reasonably safe to say, if you need to worry about the limit, you're probably approaching the problem in an inefficient manner and need to step back and rethink the solution.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 15, 2008 at 6:40 am
I agree with Grant. You might need to rethink the SP.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply