Home > Archive > MS SQL Server MSEQ > October 2006 > XML Hierarchy Data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XML Hierarchy Data
Sekhar

2006-10-24, 6:49 pm

Hello All

I have two Table Employee and Dept

Employee Columns
EmpID
EmpName
MgrID
DeptID

EmpID(PK) MgrID (FK)

Dept COlumns

DeptID
DeptName

I need to return XMl Hierarchy when I pass DeptID as a parameter
So my final result shoudl look like this

<Dept>
<Emp ID="" Name="" .....>
<Emp ID="" Name="">
</Emp>
</Emp>
<Emp ID="" Name="">
</Emp>
<Emp ID="" Name="">
</Emp>
</Dept>

How do I write this Query

Regards

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com