Home  >  Article  >  Database  >  sqlserver插入xml节点的问题

sqlserver插入xml节点的问题

WBOY
WBOYOriginal
2016-06-07 15:39:551291browse

问题描述:sql2008环境下,有一个users表,其中userinfo字段是XML类型,值是 rootxmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/users" user userid1/userid userNametest1/userName /user /root 现在要在 user 节点下插入另一节

问题描述:sql2008环境下,有一个users表,其中userinfo字段是XML类型,值是


    
        1
        test1
    

   

 

现在要在节点下插入另一节点:

shanghai

运行语句
    UPDATE Users SET UserInfo.modify('insert 
shanghai
 
     into (/root/user)[1]
')  

提示成功了,但是运行 SELECT  * FROM Users 查看的时候,节点并没有插入成功,不知道为什么呢????截图如下

 

sqlserver插入xml节点的问题

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn