General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
I need to pull records from one table ( SQL 2000 on a Window 2000/NT platform ). One column is "Owner" another is "OwnerLink". The relation is that "OwnerLink" will contain the value that corresponds to that records parent found in "Owner".
Owner OwnerLink
ABC /* parent */
DEF ABC
GHI /* parent */
JKLMN GHI
OPQ JKLMN
ZZZ GHI
etc....
I want to pass the value of any "Owner" and get all the children.
This relationship is at least six layers deep, could be more. Does anyone have any experience or success with styling a recursive function/procedure that can return all the "Owners" and their children by passing one parameter and getting a one column result set of related "Owners" back with records from the same table.
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only