UPDATE [xmlFormat] SET 
[xmlData].modify('replace value of (//*[@id="123"]/@defvalue)[1] with "30"') where  id=19执行后,不起作用。为什么呢??多谢!

解决方案 »

  1.   

    这个不懂,看这里有相关内容没有?
    SQLServer2005 XML在T-SQL查询中的典型应用
    http://topic.csdn.net/u/20081107/17/68aaf5a9-c596-4ab5-ae18-f3370b2ab35b.html
      

  2.   

    自己解决了。。replace不能新建
    UPDATE [xmlFormat] SET 
    [xmlData].modify('delete  (//*[@id="123"]/@defvalue)[1]') where  id=19
    UPDATE [xmlFormat] SET 
    [xmlData].modify('insert attribute defvalue {"30"} into (//*[@id="123"])[1]') where  id=19