How to read data from XML that is stored as image type in SQL? -
I have an XML stored in the image type in SQL. What I am trying to accomplish and actually accomplish it is to get data from that archived XML. The problem is that the data is stored as Unicode, but the data that is getting is an integral type of data. I have tried a lot but it can not work
DECLARE @ xml XML; Set @ xml = convert (xml, (convert (max (max), @dta))); 'Name' as 'SELECT Tcquery' ('data (node1 / id)') as 'id', Tcvalue ('node1 [1] / name [1]', 'nvarchar (100)'), as 'name' @ xml. Nodes ('Test 1 / Test 2') T (C)
I am converting data into varchar (max) because when I call it nerve (max), if i Change the code
set @xml = convert (xml, (CONVERT (nvarchar (max), @data);
I see any data
Thanks for the help.
on the fly in XML To change Try Cast (@data as xml)
Comments
Post a Comment