add Prefix to XML tag in FOR XML AUTO mode

conanl

New Member
I'd like to know if it possible to add \[code\]TAG PREFIX\[/code\] before every ELEMENT TAG in the result of \[code\]FOR XML AUTO\[/code\] mode
I Know its possible with \[code\]RAW\[/code\] mode but i need to make its as hierarchy as possible xml result Something Like this : \[code\] <prefix:attName> <prefix:ID>value</prefix:ID> <prefix:name>value</prefix:name> </prefix:attName>\[/code\]and the query in the \[code\]RAW\[/code\] mode will be like this\[code\]SELECT ID, Name,FROM TableName FOR XML RAW ('prefix'), ROOT('prefix:attName'), ELEMENTS\[/code\]Thanks.
 
Back
Top