Chapter 2. FOR XML and Legacy XML Support

SQL Server 2008 supports XML generation from relational data via the FOR XML clause of the SELECT statement. The FOR XML clause is a flexible and versatile way to quickly and easily construct XML from your relational data. SQL Server 2008 continues the tradition of FOR XML clause support, including the following enhancements to the FOR XML clause:

  • The addition of PATH mode simplifies, and adds flexibility to, the process of specifying an explicit structure for your XML data.

  • The XSINIL and ABSENT modifiers for the ELEMENTS option provide fine-grained control over SQL NULL representation in your XML result.

  • The TYPE option for converting your result XML to the xml data type.

  • Support is included for nested ...

Get Pro SQL Server 2008 XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.