Table of the five xml methods, what each returns and the result in this post: query() returns xml, value() returns an int you choose, exist() returns a bit, modify() changes the XML, and nodes() returns 5 rows from 2 documents

XML Data Type Methods in SQL Server: query, value, exist, modify and nodes

XML data type methods are the five functions you call on an xml column or variable: query(), value(), exist(), modify() and nodes(). Each gives back a different kind of answer: xml, a typed value, 1 or 0, a changed document or rows. This post runs all five on one small table of seeds, shows two common errors, and asks SQL Server what each method returns. Every result comes from SQL Server 2025.

Read More