Re: Output nested set model (--CELKO--) to XML
Date: 16 Sep 2002 08:05:35 -0700
Message-ID: <ac5e4ae2.0209160705.52a4d05b_at_posting.google.com>
Nikola,
Thank you very much for your help. Very simple - which is great. I'd like to pipe this XML into a TreeView control and now need to figure out the best way to strip the lft column. I would like to avoid cursors and temporary tables, so another simple and effective idea from you would be very useful.
Thanks again for your help.
Simon.
koleto_at_hotmail.com (Nikola Kavaldjiev) wrote in message news:<68884ef.0209101402.31251907_at_posting.google.com>...
> Try the following:
>
> SELECT lft, xmltext = '<node emp="' + emp + '">'
> FROM Personnel
> UNION ALL
> SELECT rgt, xmltext = '</node>'
> FROM Personnel
> ORDER BY 1
>
>
> The xml is in the second column (xmltext), just wrap the
> <root>...</root> around it, if you need to.
> Pretty much the same thing is possible with the Itzak Ben-Gan's path
> enumeration model.
>
> Actually, the credit goes to Alexander Sinyaev's post:
>
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=e7098d2302571196&seekm=1017265884%40p13.f1197.n5030.z2.ftn#link1
>
> Regards,
> Nikola
>
>
Received on Mon Sep 16 2002 - 17:05:35 CEST
