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 RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
October 15, 2008 at 6:40 am
I agree with Grant. You might need to rethink the SP.
Follow me on Twitter: http://www.twitter.com/way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply