The xml Data Type

SQL Server 2005 introduced a new xml data type that supports storing XML documents and fragments in database columns or variables. The xml data type can be used with local variable declarations, as the output of user-defined functions, as input parameters to stored procedures and functions, and much more. The results of a FOR XML statement can easily be stored in a column, stored procedure parameter, or local variable. XML data is stored in an internal binary format and can be up to 2GB in size. XML instances stored in xml columns can contain up to 128 levels of nesting.

xml columns can also be used to store code files such as XSLT, XSD, XHTML, and any other well-formed content. These files can then be retrieved by user-defined ...

Get Microsoft® SQL Server 2008 R2 Unleashed 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.