XML in SQL Server 2008—the xml Data Type

SQL Server 2005 introduced a new data type, xml, for working with XML data, and SQL Server 2008 further enhances it. Using this new data type, you can store XML in its native format, query the data within the XML, efficiently and easily modify data within the XML without having to replace the entire contents, and index the data in the XML. You can use xml as any of the following:

  • A variable

  • A parameter in a stored procedure or a user-defined function (UDF)

  • A return value from a UDF

  • A column in a table

There are some limitations of the xml data type that you should be aware of. Although this data type can contain and be checked for null values, unlike other native types, you cannot directly compare an instance ...

Get Programming Microsoft® SQL Server™ 2008 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.