Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flat Data to XML

Status
Not open for further replies.

Stunner01225

Technical User
Mar 13, 2002
150
GB
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


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top