T-SQL Hierarchy Recursive Function

  • I have a table that lists the employee and their supervisor

    For example

    employee_id    supervisor_id

    1234               5678

    5678               7892

    7892               9999 

    I need to load in a new SUPERVISORS table (fields supervisor_id, supervisee_id), all the supervisors and who they supervise, and who they supervise, supervise, etc.....

    So, 7892 supervises 1234 and 5678

    and   9999 supervises 7892,1234, and 5678.

    Is there a simple way I could create this, like in a stored proc?

    Thanks in advance!

  • I would recommend you to read this


    * Noel

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply