Hello,
Is it possible to output a column as cdata when using xml path?
For example:
Code:
SELECT CustomerID as "@CustomerID",
CompanyName,
Address as "address/street",
City as "address/city",
Region as "address/region",
PostalCode as "address/zip",
Country as "address/country",
ContactName as "contact/name",
ContactTitle as "contact/title",
Phone as "contact/phone",
Fax as "contact/fax"
FROM Customers
FOR XML PATH('Customer'), ROOT('doc')
Is there a way to output street address as cdata? Right now I'm using FOR XML EXPLICIT to output cdata, but my query is getting quite complicated and I would like to switch to the path method.
Thanks!