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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Recursive Joins & FOR XML EXPLICIT

Author  Topic 

iwaters
Starting Member

13 Posts

Posted - 2003-05-19 : 14:27:39
I have a table structured like this:

| ID | ParentID | Type | Name |
--------------------------------
| 1 | NULL | 1 | Test |

etc etc.

I want to get an XML hierarchy out of the database. The tree will only ever go down 4 levels so I guess I can manually structure the joins and not create a recursive function, I just cant work out how to do it using the FOR XML clause. I have seacrhed the internet but all the examples are for more than one table and I can apply them to my problem. Please can someone help as I am going nuts! I want to be able to convert the XML using ASP and/or XSL. I dont want to use the HTTP/URL method and virtual directories.

Many Thanks

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2003-05-19 : 17:40:28
Start with this article and all of its comments. It should get you going on a good start. [url]http://www.sqlteam.com/item.asp?ItemID=8866[/url]

------------------------------------------------------
The more you know, the more you know you don't know.
Go to Top of Page
   

- Advertisement -