Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Recursive SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-12-06 : 07:45:46
Dave writes "Your answer for a Recursive SQL seems lacking an important part. The answer. (That's an answer?)
I think you are officially STUMPED.
First answer was at: http://4guysfromrolla.com/webtech/sqlguru/q120899-1.shtml by Michael S., Then Kurt wanted a little more...
http://www.4guysfromrolla.com/webtech/sqlguru/q121799-1.shtml

Then Scott (the webmaster) says that he did it back in 99.
Scott maybe you can show Sean, then Sean can create an answer to the question of:

PostID
ParentID

{HINT: The answer is looping a Select TOP 1 with JOIN PostID=ParentID - with a NOT IN (from the previous result set).
Just put the results in a temp table. Oh, and if you want to pick an choose a small subsegment of the tree - just pass a var to it for the starting PostID - that way you'll only pick off the subsegment of related data that you want.}

Works for me. But what do I know.
Dave
Not really a programmer/Analyst
Just do a little coding for myself
Don't work for anybody and I don't have anything to plug.
(cunfusion says: Self-praise is no recommendation)"

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-06 : 07:51:08
Is there something you want to ask?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-06 : 10:54:52

http://www.nigelrivett.net/RetrieveTreeHierarchy.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -