Information générale
Forum:
Microsoft SQL Server
Catégorie:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement