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 2005 Forums
 Transact-SQL (2005)
 Loading tree node siblings

Author  Topic 

omlac
Starting Member

1 Post

Posted - 2008-09-03 : 07:48:26
does anyone has an idea how i go about loading/selecting information for a tree node and all its sublings, including siblings of siblings right at the very last sibling.
I have a table with the locationid, locationname, parentlocationid. and for each location i want to select all its siblings and subsiblings, i have done something similar in c# but do to perfomance problems i want to do it from SQL.

Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-03 : 09:02:04
Books Online has examples of how to write recursive common table expressions.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -