O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

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

The Built-in xml Data Type Methods

Now that you know how to create and manage typed and untyped xml columns, the next step is to learn how to query and modify stored XML content. Although SQL Server supports only a subset of the XQuery 1.0 recommendation, you’ll soon see that it’s plenty to get the job done.

Keep in mind that a mastery of XQuery is not a requirement for selecting out XML data; you can just specify the name of the xml column to select all the data back at once.

SQL Server provides five built-in methods on the xml data type: query(), exist(), value(), nodes(), and modify(). These methods are appended to the name of the xml column in question, using the ColumnName.MethodName([MethodParameters]) syntax. These methods work on XML ...

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