Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Recursive SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-10 : 09:10:21
Balaji writes "Hi,

I am looking for an effective (in less time) way of writing a recursive query. For Eg: If given an employee ID, I need to find all the employees in his/her organization, i.e given a VP employee number, I need to select all the Managers reporting to her/him and people reporting to those Managers.

-Balaji"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-10 : 09:13:15
Refer http://www.nigelrivett.net/RetrieveTreeHierarchy.html
or post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-07-10 : 11:23:01
Also, let us know if you are using SQL 2005, since it can do recursion quite easily.

- Jeff
Go to Top of Page
   

- Advertisement -