Greetings.
I want to create a tree control which will list all the employees in an
employee table in the correct hierarchy like
<company>
managers
sub managers
employees
For that, how can I setup reflective linking (linking ot the same table) in
SQL server and how can I populate the tree control from it ?
Thanks!You may have a look here:
(Quelle:
_5yk3.asp" target="_blank">http://msdn.microsoft.com/library/d...r />
_5yk3.asp)
But the main part to populate the tree should be implemented in your
frontend apllication. The best thing would be to set up some recursive
function which alway try to first retrieve the "manager" and the search for
the next level, and so on.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"news.microsoft.com" <v-hshah@.microsoft.com> schrieb im Newsbeitrag
news:%23uukSelZFHA.3364@.TK2MSFTNGP09.phx.gbl...
> Greetings.
> I want to create a tree control which will list all the employees in an
> employee table in the correct hierarchy like
> <company>
> managers
> sub managers
> employees
>
> For that, how can I setup reflective linking (linking ot the same table)
> in SQL server and how can I populate the tree control from it ?
> Thanks!
>|||Get a copy of TREES & HIERARCHIES IN SQL for details, but look up the
"nested set model" on Google. There is no need for self-referencing
tables, recursion or procedural code.
No comments:
Post a Comment