I have a comment section in my application. I pass xml doc to my procedure.
I would like to store the CDATA section of my xml doc in a column without any conversion.
declare @xml xml
set @xml=
'<response>
<test>
<![CDATA[<greeting>Hello, world!</greeting>]]>
</test>
</response>'
select @xml.query('data(/response/test)')
Select @xml
select cast(@xml.query('data(/response/test)') as varchar(124))
above query will give
<greeting>Hello, world!</greeting>
is there way to preserve the special characters in xquery result..
something like..
<greeting>Hello, world!</greeting>
Thanks.