Click here to Skip to main content
15,894,825 members
Articles / Database Development / SQL Server / SQL Server 2008

T- SQL - How to get all descendants of a given element in a hierarchical table

Rate me:
Please Sign up or sign in to vote.
4.46/5 (7 votes)
13 May 2009CPOL1 min read 49.6K   36  
This article provides a T-SQL table valued function that retrieves all the descendant rows of a given row in a hierarchical table.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Italy Italy
Paolo Costa is a software developer with long experience on any kind of .NET application. He lives in Italy and works in Switzerland for a credit card payment acquiring company.

Comments and Discussions