by
0
6
4,145
4
Top 1% !
Popular
Famous
Tagged
Specified
OpenSource
Popularity: 2395th place
DBMSMS SQL Server
LanguageT-SQL
LicenseMIT_X11
OSWindows

Query XML fields' content in MS SQL Server

This is the right syntax to perform XQuery queries for XML columns in a SQL Server table
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/22722/Query-XML-fields--content-in-MS-SQL-Serv?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
SELECT MyField.query(' declare namespace s2c="http://www.snip2code.com/namespaces/s2c"; (/s2c:myroot/myelem/fieldIwant[1]/text())') FROM MyTable
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus