Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 6da367a

Browse files
authored
Merge pull request #464 from greglow/patch-48
Improved readability and consistency in code sample
2 parents 17281b3 + 42e6a34 commit 6da367a

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

docs/t-sql/xml/query-method-xml-data-type.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,16 @@ declare namespace wm="http://schemas.microsoft.com/sqlserver/2004/07/adventure-w
104104
Note that the query() and exist() methods both declare the PD prefix. In these cases, you can use WITH XMLNAMESPACES to first define the prefixes and use it in the query.
105105

106106
```
107-
WITH XMLNAMESPACES (
107+
WITH XMLNAMESPACES
108+
(
108109
'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription' AS PD,
109-
'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain' AS wm)
110-
SELECT CatalogDescription.query('
111-
<Product ProductModelID="{ /PD:ProductDescription[1]/@ProductModelID }" />
112-
') as Result
110+
'http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain' AS WM
111+
)
112+
SELECT CatalogDescription.query('<Product ProductModelID="{ /PD:ProductDescription[1]/@ProductModelID }" />')
113+
AS Result
113114
FROM Production.ProductModel
114-
where CatalogDescription.exist('
115-
/PD:ProductDescription/PD:Features/wm:Warranty ') = 1
115+
WHERE CatalogDescription.exist('/PD:ProductDescription/PD:Features/WM:Warranty ') = 1;
116+
116117
```
117118

118119
## See Also

0 commit comments

Comments
 (0)