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

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 ...

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