Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recursive calls
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Recursive calls
Divers
Thread ID:
00516517
Message ID:
00516517
Vues:
48
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
Fil
Voir

Click here to load this message in the networking platform