Thursday, November 26, 2009

Get table data as XML

Get Customer data as XML, return CustomerID as attribute and CustomerName as value

SELECT 1 AS Tag,
NULL AS Parent,
CustomerId AS [Customers!1!CustomerId],
CompanyName AS [Customers!1]
FROM Customers
FOR XML EXPLICIT

No comments:

Post a Comment