custom xml and sql server

jayderamu

New Member
I have created xml from sql server 2008.My Current xml is generated using "FOR XML AUTO"\[code\]<Customer Name="john" City="Mumbai"> <Project Project_Name="pqr" /></Customer><Customer Name="Rocky" City="Delhi"> <Project Project_Name="abc" /> <Project Project_Name="lmn" /></Customer>\[/code\]But I want the output like\[code\]<Customer > <name>John</name> <city>Mumbai</city> <Projects> <project> <Project_Name>pqr</Project_Name> </project> </Projects></Customer><Customer > <name>Rocky</name> <city>Delhi</city> <Projects> <project> <Project_Name>abc</Project_Name> <Project_Name>lmn</Project_Name> </project> </Projects></Customer>\[/code\]So basically i want to convert attributes of the parent element to sub-elements. And want additional customize elements. Please help me.Thanks in Advance.
 
Back
Top