Posted by Erland Sommarskog on 10/20/42 11:56
rhaazy (rhaazy@gmail.com) writes:
><root>
><USA>
> <Manistique>
> <M-Sales/>
> <M-IT/>
> </Manistique>
> <Houston>
> <H-Sales/>
> <H-IT/>
> </Houston>
></USA>
><CANADA>
> <Toronto>
> etc...
></root>
>
> Hopefully this format is possible...
It does not seem to be. When I look at the examples for FOR XML EXPLICIT
and FOR XML PATH, they don't lead to that result. And indeed the XML
document above is sort of funny. A more normal document would be:
<ROOT>
<OrgSystem Name="USA">
<UpperOrgNode Name="Manistique">
<LowerOrdNode Name="M-Sales"/>
<LowerOrdNode Name="M-IT"/>
</UpperOrgNode>
etc.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|