다음을 통해 공유


XQuery의 주석

적용 대상:SQL Server

XQuery에 주석을 추가할 수 있습니다. 주석 문자열은 "(:" 및 ":)" 구분 기호를 사용하여 추가됩니다. 예:

declare @x xml  
set @x=''  
SELECT @x.query('  
(: simple query to construct an element :)  
<ProductModel ProductModelID="10" />  
')  

다음은 xml 형식의 명령 열에 대해 쿼리를 지정하는 또 다른 예입니다.

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