Re: Hierachical Relationship driving me nuts.
- From: "Robbe Morris [C# MVP]" <joeblow@xxxxxxx>
- Date: Wed, 13 Dec 2006 22:32:29 -0500
If you are using SQL Server 2005, you can use
the WITH clause and CTE to derive this stuff
pretty easily.
http://www.eggheadcafe.com/articles/sql_server_recursion_with_clause.asp
--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
"JJ" <abc@xxxxxxx> wrote in message news:ONKXziuHHHA.420@xxxxxxxxxxxxxxxxxxxxxxx
I am trying to set up a SQL table with associated stored procedures to be able to have nested 'categories' to any depth.
I need to then be able to retrieve (or move or delete) a particular category and its children (to a specified depth) and display it in a repeater (for example). i.e.
category1
---category1 child
------categrory1 grandchild
category2
---category2 child
------category2 grandchild
There must be many of you that have done this. I have tried many different attemps, but I suspect my lack of SQL knowledge may be the reason for my failure.
I understand there is something called the adjacency list model .....??
Can anyone point me to any resources and offer any advice??
Many thanks,
JJ
.
- Follow-Ups:
- References:
- Prev by Date: Re: Known types and web services
- Next by Date: Re: Check if user is in Role
- Previous by thread: Re: Hierachical Relationship driving me nuts.
- Next by thread: Re: Hierachical Relationship driving me nuts.
- Index(es):
Relevant Pages
|