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)
 Nested set model

Author  Topic 

stsql
Starting Member

19 Posts

Posted - 2006-06-23 : 10:57:52
Hi,

I've been dabbling with the nested model set and have managed to get the basics going.

I was using this article: http://www.developer.com/db/article.php/10920_3517366_1

With the database:

CREATE TABLE BreadCrumbLinks(
SiteAreaName CHAR(32) NOT NULL PRIMARY KEY,
SiteAreaUrl CHAR(32) NOT NULL,
Lft INTEGER NOT NULL,
Rgt INTEGER NOT NULL);


Within this article it explains how to display hte heirachi of any node:

SELECT C.*
FROM BreadCrumbLinks AS B, BreadCrumbLinks AS C
WHERE (B.Lft BETWEEN C.Lft AND C.Rgt)
AND (B.SiteAreaName = 'Ping)
ORDER BY C.Lft


this is all working fine. But the I can't figure out the SQL to display a full tree of all nodes and paths as one statement.

Does anyone know how to achieve this?
Thanks,


Richard

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-26 : 02:04:15
Refer this
http://www.nigelrivett.net/RetrieveTreeHierarchy.html

Madhivanan

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

stsql
Starting Member

19 Posts

Posted - 2006-06-27 : 12:12:03
Thanks, I'll give that a go.

R
Go to Top of Page
   

- Advertisement -