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.
| Author |
Topic |
|
evgeny
Starting Member
1 Post |
Posted - 2011-04-28 : 17:21:50
|
| hello gurusI have a question.I have requirement o develop some organization hierarchy modul that alows next rules.1.every employee have only one manager2.no loops in the organization A->B->C->Ahow can i use heirarchyid or this?Evgeny. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-04-28 : 17:57:37
|
| use a recursive cte (Common Table Expression).JimEveryday I learn something that somebody else already knew |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2011-04-28 : 18:19:17
|
| You might want to do some research on Tree and Hierarchies in SQL. Joe Celko wrote a book on the subject and there are lots of articles around the web on the topic. A couple key phrase that might help your seach are "Nested Sets" and "Adjacency List Model". |
 |
|
|
|
|
|