Here, is the Sample XML which we are trying to parse:
DECLARE @x XML
SELECT @x = '
<info>Sample XML TEST</info>
If we need to fetch the “info” element with T-SQL we can write query as follows:
;WITH XMLNAMESPACES(DEFAULT 'http://schemas.microsoft.com/search/local/ws/rest/v1')
FROM @x.nodes('/X') x (v)
Here, we have to use “WITH XMLNAMESPACES”, so we can specify the namespace of the XML that we are reading, else it wont give us any result.
Posted by Tejas Shah on November 22, 2017
Posted by Tejas Shah on November 11, 2017
Posted by Tejas Shah on August 12, 2015
Posted by Tejas Shah on June 26, 2015
Posted by Tejas Shah on April 20, 2015