如何在ntext列中更新XML?

时间:2015-05-25 02:07:46

标签: xml sql-server-2008

我在ntext列中有一个这种结构的xml

<car>
<model>Accord</model>
<engine></engine>
<description><p>As new</p></description>
<notes><p>English</p></notes>
</car>

我想更新<description>列,比方说,<p>As <b>new</b><p>

我尝试过使用中间表但是当我说

insert into @Temp (xdoc) 
select CAST(xml as xml) from MyTable
WHERE Id = @Id

@Temp表中的xdoc包含转义的html字符

<description>&lt;p&gt;As new&lt;/p&gt;</description>

我无法使用for xml explicit或作业声明insert

我应该使用REPLACE替换带有正确字符的转义字符,还是有更好的方法?

0 个答案:

没有答案
相关问题