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
 SQL Server Development (2000)
 Reverse recursion -

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-13 : 09:57:02
Hakan Bilgin writes "Hello,

As in many other cases, I have a table with columns "id" and "parentId" for hierarchical structure. Now how can I write an sp that is reverse recursive; that needs two params, id (can be any "child-element" in the structure) and endAtId (any "parent-element" to the "child-element"). There is no limit to levels between id and endAtId. When executed the sp retuns an xml doc structured using parentId.

Much like the toc-view at msdn. The document is retrieved, than the tree-depth is loaded, down to the right node.

Thanx in advance."
   

- Advertisement -