sql – 使用XQUERY / Modify用varchar字段中的值替换我的XML片段
发布时间:2020-05-24 16:40:23 所属栏目:MsSql 来源:互联网
导读:我有一张桌子: MyTable config as XML title as varchar(255) 在MyTable.config中,我有以下结构的XML: configuration pagetitle=myConfig column row component id=1 type=MyPiece title=My Title t
|
我有一张桌子: MyTable config as XML title as varchar(255) 在MyTable.config中,我有以下结构的XML: <configuration pagetitle="myConfig">
<column>
<row>
<component id="1" type="MyPiece" title="My Title" text="junk" />
</row>
</column>
</configuration>
我需要一个脚本将MyTable.text的值注入我的配置XML中的组件节点的text属性中. 我知道这是错的,但我想做类似的事情: UPDATE MyTable SET config.configuration.column.row.component.title = title 解决方法UPDATE MyTable
SET Config.modify('
replace value of (/configuration/column/row/component/@title)[1]
with sql:column("title")
') (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 关于SQLServer2005的学习笔记 XML的处理
- linux mysql5.6版本的安装配置过程
- SQL小技巧 又快又简单的得到你的数据库每个表的记录数
- sql – 在午夜获取今天的日期和时间,并添加到它
- SQL Server 多表关联时在where语句中慎用trim()方法
- sql-server – 通过Internet连接到SQL服务器
- sql-server – SQL存储过程是否区分大小写?
- MySQL timestamp的类型与时区实例详解
- sql-server – 比较Varchar和UniqueIdentifier
- sql-server – SQL Server索引顺序(datetime字段)
