Stunner01225
Technical User
I have a table with three fields An ID field, a parent ID field and a title field. The table stores the staff hierarchy. So the values are like
1|null| Director
2|1| First Sub Director
3|2| Second Sub Director
4|1| First sub director PA
And so on.
I need to convert this flat table into a hierarchical XML document. I though it would be quite simple using For XML Explicit, but I am afraid I have run into a brick wall. Anybody know the best way to do this (solve the problem I mean, not running into a brick wall as I have already mastered that)? What should I be doing?
Thanks For any help.
Using SQL Server 2000
1|null| Director
2|1| First Sub Director
3|2| Second Sub Director
4|1| First sub director PA
And so on.
I need to convert this flat table into a hierarchical XML document. I though it would be quite simple using For XML Explicit, but I am afraid I have run into a brick wall. Anybody know the best way to do this (solve the problem I mean, not running into a brick wall as I have already mastered that)? What should I be doing?
Thanks For any help.
Using SQL Server 2000