Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
SQL Server
You can add comments to XQuery. Add comment strings by using the (: and :) delimiters. For example:
DECLARE @x AS XML;
SET @x = '';
SELECT @x.query('
(: simple query to construct an element :)
<ProductModel ProductModelID = "10" />
');
The following example shows a query against an Instructions column of the xml type:
SELECT Instructions.query('
(: declare prefix and namespace binding in the prolog. :)
declare namespace AWMI = "http://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;