Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 2.95 KB

File metadata and controls

54 lines (45 loc) · 2.95 KB
title xml Data Type Methods | Microsoft Docs
ms.custom
ms.date 03/16/2017
ms.prod sql
ms.prod_service sql-database
ms.reviewer
ms.suite sql
ms.technology t-sql
ms.tgt_pltfrm
ms.topic language-reference
dev_langs
TSQL
helpviewer_keywords
xml data type [SQL Server], methods
methods [XML in SQL Server]
ms.assetid d112b9c9-be9f-435c-a9e6-d21b65778fb7
caps.latest.revision 32
author douglaslMS
ms.author douglasl
manager craigg

xml Data Type Methods

[!INCLUDEtsql-appliesto-ss2012-xxxx-xxxx-xxx-md]

You can use the xml data type methods to query an XML instance stored in a variable or column of xml type. The topics in this section describe how to use the xml data type methods.

In This Section

Topic Description
query() Method (xml Data Type) Describes how to use the query() method to query over an XML instance.
value() Method (xml Data Type) Describes how to use the value() method to retrieve a value of SQL type from an XML instance.
exist() Method (xml Data Type) Describes how to use the exist() method to determine whether a query returns a nonempty result.
modify() Method (xml Data Type) Describes how to use the modify() method to specify XML Data Modification Language (XML DML)statements to perform updates.
nodes() Method (xml Data Type) Describes how to use the nodes() method to shred XML into multiple rows, which propagates parts of XML documents into rowsets.
Binding Relational Data Inside XML Data Describes how to bind non-XML data inside XML.
Guidelines for Using xml Data Type Methods Describes guidelines for using the xml data type methods.

You call these methods by using the user-defined type method invocation syntax. For example:

SELECT XmlCol.query(' ... ')  
FROM   Table  

Note

The xml data type methods query(), value(), and exist() return NULL if executed against a NULL XML instance. Also, modify() does not return anything, but nodes() returns rowsets and an empty rowset with a NULL input.

See Also

Compare Typed XML to Untyped XML
Create Instances of XML Data