Recursive Query Help
Posted
by Josh
on Stack Overflow
See other posts from Stack Overflow
or by Josh
Published on 2010-03-29T16:11:40Z
Indexed on
2010/03/29
16:33 UTC
Read the original article
Hit count: 434
I have two tables in my database schema that represent an entity having a many-to-many relationship with itself.
Role
---------------------
+RoleID
+Name
RoleHasChildRole
---------------------
+ParentRoleID
+ChildRoleID
Essentially, I need to to be able to write a query such that:
Given a set of roles, return the unique set of all related roles recursively.
This is an MSSQL 2008 Database.
© Stack Overflow or respective owner