September 2010
Intermediate to advanced
1704 pages
111h 8m
English
RAW ModeWhen specified at the end of a SELECT statement, the keywords FOR XML RAW tell SQL Server to generate a one-XML-element-per-row structure. The FOR XML statement has a few options that change its output from the default of document fragments to well-formed documents with a slightly (compared to a few other FOR XML options) reshaped structure. This is its syntax:

Listing 47.1 illustrates the XML generated by the no-option version of FOR XML RAW. (Note that all the code in this chapter relies on the AdventureWorks2008 sample database.)
Listing 47.1 A SELECT Statement That Uses FOR XML RAW with No Additional Modifiers
This kind of XML shape ...