RE: SQL Procedure- Hierarchy listing of table content

From: Alejandro Mesa (AlejandroMesa_at_discussions.microsoft.com)
Date: 02/16/05


Date: Wed, 16 Feb 2005 12:27:04 -0800

See "Expanding Hierarchies" in BOL. If you are interested in a method other
thatb adjacency list then:

Trees in SQL
http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=397531

Trees in SQL: Nested Sets and Materialized Path
http://www.dbazine.com/tropashko4.shtml

Joe Celko's Trees and Hierarchies in SQL for Smarties
http://www.amazon.com/exec/obidos/tg/detail/-/1558609202/qid=1108585417/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/103-6312162-7087830?v=glance&s=books&n=507846

AMB

"Ludwig via SQLMonster.com" wrote:

> Have an employee_tbl ( employee_id,, Manager_id), need a procedure or
> function whose outcome will list the company hierarchy (top to buttom
> regardless of the level depth) of Who reports to Who based on data in
> Employee_tbl. i.e.
>
> John Doe
> Jane Doe -----| kerry ---- | Bugsie--|Joe
> | Marg | Klein
> | Rose
> Jack Hanna ---| Kelly
> |Steve
>
> Martina Higis-|Patrick
> |bernice
>
> Thanks in advance
>
> --
> Message posted via http://www.sqlmonster.com
>