Re: Hierachical Relationship driving me nuts.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: Hierachical Relationship driving me nuts.
    ... updatting all children) to help me understand how I can apply it. ... category and its children (to a specified depth) and display it in a ... ---category1 child ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Hierachical Relationship driving me nuts.
    ... PK ParentID Name ... category and its children (to a specified depth) and display it in a ... ---category1 child ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: New AD tree or AD forest?
    ... we have one forest with one domain. ... the clients will authenticate against IIS and then again through SQL server ... You can create child domains under this domain. ... If internal AD user accounts, and the SQL server is already joined to the domain and is currently using AD accounts for services, authentication, etc, then you don' have to go any further. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Using a "match" table to store multiple columns for parent data
    ... Category1 = MAX, ... FROM ProductCategories PC ... If you want more product categories, you will need to extend the query. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Finding DataRelation Orphans
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... I know I have some orphaned rows, and I like to list them out. ... collection on the child table and looking at the ParentRow property, ...
    (microsoft.public.dotnet.framework.adonet)