How to rename XML node name in a SQL Server

后端 未结 1 344
無奈伤痛
無奈伤痛 2021-01-20 19:24

I have on my database a table with one column storing XML data. Due to changes in the source code we want to rename one specific XML node name and XML namespace. Lets say th

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 20:20

    I don't know if this is possible with XML DML

    It might work for you to use replace instead.

    update YourTable set
      XMLCol = replace(replace(cast(XMLCol as nvarchar(max)), 
                               '', 
                               ''), 
                       '', 
                       '')
    

    0 讨论(0)
提交回复
热议问题