1

I have a Xml Column in a SQL Server 2012 database table called ValidationList. I have a few hundred records in this table.

I have a record like follows

<Configuration xmlns="blah">
  <CheckTest name="ValidationA">
    <TestName>NumericTest</TestName>
  </CheckTest>
</Configuration>

I need to Update all the rows and Rename the Node TestName to ValidationName, how can i do this in SQL script?

Thanks

4

1 に答える 1

2

を使用する1つの方法を次に示しreplaceます。

update yourtable
set yourcolumn = 
       replace(cast(yourcolumn as nvarchar(max)), 'TestName', 'ValidationName');
于 2014-11-27T01:05:17.727 に答える