O'Reilly logo

Programming Microsoft® SQL Server™ 2008 by Leonard Lobel, Andrew Brust, and Stephen Forte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

FOR XML Commands

SQL Server 2000 introduced an enhancement to the T-SQL syntax that enables normal relational queries to output their result set as XML, using any of these three approaches:

These three features are also supported in SQL Server 2005 and 2008. We’ll first discuss the features common to all three versions and then look closely at the new and enhanced features available in SQL Server 2008.

FOR XML RAW

FOR XML RAW produces attribute-based XML. FOR XML RAW essentially creates a flat representation of the data in which each row returned becomes an element and the returned columns become the attributes of each element. FOR XML RAW also doesn’t interpret joins in any special way. (Joins become relevant ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required