xquery-xqueries-handling-relational-data
xqueryYou specify XQuery against an
type column or variable by using one of the
XML Data Type
Methods. These include
,
,
, or. The XQuery is executed against
the XML instance identified in the query generating the XML.
The XML generated by the execution of an XQuery can include values retrieved from other
Transact-SQL variable or rowset columns. To bind non-XML relational data to the resulting
XML, SQL Server provides the following pseudo functions as XQuery extensions:
sql:column()
function
sql:variable()
function
You can use these XQuery extensions when specifying an XQuery in the
method of the
data type. As a result, the
method can produce XML that combines data from XML
and non-
data types.
You can also use these functions when you use the
data type methods
,
,
, and
to expose a relational value inside XML.
For more information, see
sql:column() function (XQuery)
and
sql:variable() function (XQuery).
XML Data (SQL Server)
XQuery Language Reference (SQL Server)
XML Construction (XQuery)