December 2001
Intermediate to advanced
800 pages
17h 55m
English
FOR XML AUTO gives you more control than RAW mode over the XML fragment that's produced. To begin with, each row in the result set is named after the table, view, or table-valued UDF that produced it. For example, here's a basic FOR XML AUTO query:
SELECT CustomerId, CompanyName FROM Customers FOR XML AUTO
(Results abridged)
XML_F52E2B61-18A1-11d1-B105-00805F49916B --------------------------------------------------------------------------- <Customers CustomerId="ALFKI" CompanyName="Alfreds Futterkiste"/><>Customers CustomerId="ANATR" CompanyName="Ana Trujillo Emparedados y helados"/><>Customers CustomerId="ANTON" CompanyName="Antonio Moreno Taquer?a"/><Customers CustomerId="AROUT" CompanyName="Around the Horn"/><>Customers CustomerId="VINET" ...
Read now
Unlock full access