Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 General Discussion
»
Maximum amount of "If" statements and "Select...
Maximum amount of "If" statements and "Select CASE"
Rate Topic
Display Mode
Topic Options
Author
Message
Warren Peace
Warren Peace
Posted Tuesday, October 14, 2008 2:26 PM
SSC Veteran
Group: General Forum Members
Last Login: Monday, February 06, 2012 9:48 AM
Points: 207,
Visits: 450
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
Post #585787
Grant Fritchey
Grant Fritchey
Posted Wednesday, October 15, 2008 6:34 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 3:04 PM
Points: 13,375,
Visits: 25,159
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
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #586129
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Wednesday, October 15, 2008 6:40 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 6:14 PM
Points: 31,421,
Visits: 13,734
I agree with Grant. You might need to rethink the SP.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #586133
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.