XQuery의 주석

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