Hi,<BR><BR>I&#039m trying to build a permissions based system using ASP & SQLServer.<BR><BR>I have two tables, a users/groups table and a parent/child join table.<BR><BR>Example:<BR>tblUsersGroups<BR>Id 1 Name = Parent Company A<BR>Id 2 Name = Subsidiary Company B<BR>Id 3 Name = Subsidiary Company C<BR>Id 4 Name = User A<BR>Id 5 Name = User B<BR>Id 6 Name = User C<BR><BR>tblParentChild relationships<BR>Parent id 1 Child id 2<BR>Parent id 1 Child id 3<BR>Parent id 1 Child id 4<BR>Parent id 2 Child id 5<BR>Parent id 3 Child id 6<BR><BR>This makes &#039User A&#039 a member of the &#039Parent Company A&#039, &#039User B&#039 a member of &#039Subsidiary Company B&#039 and &#039User C&#039 is a member of &#039Subsidiary Company C&#039.<BR><BR>What I&#039m trying to do with SQL is get my user&#039s id, find out what group they belong to and show them products from that group and groups that are below them in the chain, so if you are a member of &#039Parent Company A&#039 you can see everything from Parent Company A, Subsidiary Company B, Subsidiary Company C. If you are only a member of Subsidiary Company B you can only see Subsidiary Company B&#039s products. You could then go on to define Subsidiary Company B has Team A and B etc.<BR><BR>Would I need to go through a loop to achieve this?<BR><BR>Thanks,<BR><BR>Ian