XQuery 中的注释
适用于:SQL Server
可以在 XQuery 中添加注释。 注释字符串是使用“(:
”和“:)
”分隔符添加的。 例如:
declare @x xml
set @x=''
SELECT @x.query('
(: simple query to construct an element :)
<ProductModel ProductModelID="10" />
')
下面是针对 xml 类型的 Instruction 列指定查询的另一个示例:
SELECT Instructions.query('
(: declare prefix and namespace binding in the prolog. :)
declare namespace AWMI="https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions";
(: Following expression retrieves the <Location> element children of the <root> element. :)
/AWMI:root/AWMI:Location
') as Result
FROM Production.ProductModel
where ProductModelID=7
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈