Generate XML with a certain XSD definition?



I have the following query



select A,B,C,D,E,F,... from View1


And I want to generate the following XML. Is it possible to use Sql Server for XML to do it? Or is there any other approach which can be implemented in SQL server?



<Root>
<A>....</A>
<B Id="1">
<Type C="..." D="...">
<SubType>
<Element E="..." F="....">
<G>...</G>
<H>...</H>
</Element>
<Type>
.....
</B>
.....

No comments:

Post a Comment