Update XML node value in SQL Server

后端 未结 2 1530
半阙折子戏
半阙折子戏 2020-12-13 04:48

I need to update the GroupID field to a 0. I have figured out how to retrieve the value, I am now running into problems updating it.

Any help would ge great!

2条回答
  •  無奈伤痛
    2020-12-13 05:14

    The simplest way to change the text inside element

    UPDATE [TableName]
       SET  
          [fieldName].modify('replace value of (root/elementName/text())[1] with "wBob"')
    GO
    

提交回复
热议问题