Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
The ELEMENTS directive constructs XML in which each column value maps to an element in the XML. By default, if the column value is NULL, no element is added. But by specifying the optional XSINIL parameter on the ELEMENTS directive, you can request that an element is created for the NULL value. In this case, an element that has the xsi:nil attribute set to TRUE is returned for each NULL column value.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayDocumentation
Generate XML from Rowsets with FOR XML - SQL Server
Learn how to generate an xml data type instance from a rowset by using the TYPE directive with the FOR XML clause.
Specify XSINIL with the ELEMENTS Directive - SQL Server
View an example that specifies XSINIL with the ELEMENTS directive to generate element-centric XML from the query result.
Specify a root element for use with FOR XML - SQL Server
View an example query that specifies the ROOT option of the FOR XML clause to request a single top-level element in the resulting XML.