Home Forums SQL Server 2008 T-SQL (SS2K8) Need Help on User Tree Hierarchy with Addition/Deletion Option RE: Need Help on User Tree Hierarchy with Addition/Deletion Option

  • sorry for not replying sooner.

    The Insert and Delete from the table are fairly straight forward, this issue is that you need to be able to move people in sub trees.

    The difficulty are the rules around permissions, as you need to know how to identifty Admins and Non-admins. As the permissions for users of a specific Level, are we talking about the level in the Hierarchy, ie can a user on level 1 of the hierarchy add anyone to anywhere in the second tier of the hierarchy or can he only add/remove people from his subtree.

    I suspect that an individual can only add/delete subordinates from his subtree, but this needs to be confirmed.

    You also need to define what happens to the subordinates of anyone that gets removed from the subtree, who do they attach to if there is no replacement.

    All this needs to be understood by us, as sean has stated posing the DDL of the table sys_user that you have in front of you with sample data will help us understand the data and alow us to help you a lot quicker.

    Dont rely on the data I created it was very nody based on your initial post and was there to show a method of creating what your original DDL did without the cursor and nested SP's.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices