1.传送门 :   http://www.cnblogs.com/GuoPeng/archive/2009/12/11/1621527.html

2.复制原帖的修改部分:

修改:@xml . modify(insert) | .modify(replace) | .modify(delete)

    将一段xml片段插入到制定节点后(前)after | before 

set @xmldata . modify('insert <test>Hello</test> after (//book)[last()]')

       修改掉price="39.95"的price节点的值为"50.00"

set @xmldata . modify('replace value of (/bookstore/book/price[text()="39.95"]/text())[1] with "50.00"')

      删除所有test节点

set @xmldata . modify('delete //test')

   添加属性:

set @xmldata .modify ('insert attribute testatt{"50"} into (/bookstore/book)[1]')

 

  修改属性:

set @xmldata .modify('replace value of (/bookstore/book/@testatt)[1] with "80"')

 

posted on 2018-01-08 17:27  闪光狂风  阅读(1225)  评论(0编辑  收藏  举报