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)
 cascading menu select statement

Author  Topic 

rlull
Starting Member

39 Posts

Posted - 2007-07-16 : 13:00:45
I have the following table called Categories which contains the following rows:
CatId, ParentId, CatName

with the following data:

1, 0, Articles
2, 0, Forms
3, 0, Videos
4, 1, ArticleSubCategory1
5, 1, ArticleSubCategory2
5, 4, ArticleSubSubCategory1
6, 2, FormSubCategory1
7, 2, FormSubCategory2
etc...

I would like to create a cascading menu with a single select statement so that the list would look like the following:

Articles
ArticleSubCategory1
ArticleSubSubCategory1
ArticleSubCategory2
Forms
FormSubCategory1
FormSubCategory2

Is this possible with a single select statement? Thanks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-16 : 14:06:02
There is an knowledgebase on Microsoft's site about Expanding Hierarchies

http://support.microsoft.com/kb/248915
http://msdn2.microsoft.com/en-US/library/aa172799(SQL.80).aspx


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -