I have an xml of this structure in an ntext column
<car>
<model>Accord</model>
<engine></engine>
<description><p>As new</p></description>
<notes><p>English</p></notes>
</car>
I would like to update <description>
column, lets say, to have <p>As <b>new</b><p>
.
I have tried using intermediary tables but when I say
insert into @Temp (xdoc)
select CAST(xml as xml) from MyTable
WHERE Id = @Id
xdoc in @Temp table contains escaped html chars
<description><p>As new</p></description>
I can't do for xml explicit
with insert
or assignment statements.
Should I go with REPLACE
to replace escaped chars with proper chars, or is there a better way?