SQL Flow Field Guide

Binding Relational Data Inside XML Data

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

sql:column() and sql:variable() inside XQuery

What changes

Input
none
Output or change
none

Syntax at a glance

n/a (reference page)

Work example

Bind a relational value into an XQuery when a row supplies the XML search key.

Keep SQL values typed and use the documented SQL column or SQL variable binding form.

Check your work Relational values and XQuery literals have different type and quoting rules.

Open Microsoft Learn for full syntax, permissions, and details for your version.