September 23, 2007 at 8:47 pm
Comments posted to this topic are about the item Query Hierarchical data Using CTE in T-SQL 2005
October 25, 2007 at 2:45 am
Nice example.
... 2) The maximum number of levels is 100. This is the limitation of T-SQL. ...
This is not correct! It is the default recursion limit.
Values: 0 - 32767
You can control it by adding :
SELECT ...
FROM cte
OPTION (MAXRECURSION 150);
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
October 25, 2007 at 3:34 am
MAXRECURSION will not only restrict the recursion but also raises an error when it exceeds the specified value or the default value. You can overcome this by adding a where filter in your recursive part of the cte on level column
--Ramesh
October 25, 2007 at 3:52 am
How to Query Hierarchical data Using CTE in T-SQL 2005? with sample codes....Try this!!!!!!!!!!!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply