Wednesday 9 October 2013

06. The users of AdventureWorks need to publish the details of all the customers and their address on the organization's website. To perform this task, you need to retrieve the data in the XML format.

select c.CustomerID,TerritoryID,AccountNumber,CustomerType,
 City, StateprovinceID,PostalCode from Sales.Customer c
Join Sales.CustomerAddress ca on c.CustomerID=ca.CustomerID
join Person.Address a on ca.AddressID=a.AddressID for XML Path('Customer')

No comments:

Post a Comment