是否可以在一次更新中修改单个节点上的多个属性?
Is it possible to modify multiple attributes on a single node within one Update?
我有类似的东西:
<ENTITY NAME="entity1">
<ATTR ID="attr1" CAPTION="Attributes to Change" SIZE="100" WIDTH="100"></ATTR>
</ENTITY>
我已经能够使用三个单独的更新来修改 CAPTION、SIZE 和 WIDTH 属性,但是我一直在寻找将它们组合成单个更新的方法,但徒劳无功.可能吗?
I've been able to use three separate Updates to modify the CAPTION, SIZE, and WIDTH attributes, but I've looked in vain for some way to combine them into a single Update. Is it possible?
我使用过的更新示例:
UPDATE t
SET [column_name].modify('replace value of (/ENTITY/ATTR/@CAPTION)[1] with "New Attribute Caption"')
FROM table t
UPDATE t
SET [column_name].modify('replace value of (/ENTITY/ATTR/@SIZE)[1] with "200"')
FROM table t
UPDATE t
SET [column_name].modify('replace value of (/ENTITY/ATTR/@WIDTH)[1] with "200"')
FROM table t
不,这是不可能的.
来自 替换 (XML DML) 的值.
表达式1
标识要更新其值的节点.它必须仅识别单个节点.也就是说,Expression1 必须是一个静态的单身.
Expression1
Identifies a node whose value is to be updated. It must identify only a single node. That is, Expression1 must be a statical singleton.
这篇关于一次更新sql server xml数据字段上的多个属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
我可以在不编写 SQL 查询的情况下找出数据库列表Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不编写 SQL 查询的情况下
如何创建对 SQL Server 实例的登录?How to create a login to a SQL Server instance?(如何创建对 SQL Server 实例的登录?)
如何通过注册表搜索知道SQL Server的版本和版本How to know the version and edition of SQL Server through registry search(如何通过注册表搜索知道SQL Server的版本和版本)
为什么会出现“数据类型转换错误"?使用 ExWhy do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(为什么会出现“数据类型转换错误?使用 ExecuteNonQuery()?)
如何将 DataGridView 中的图像显示到 PictureBox?How to show an image from a DataGridView to a PictureBox?(如何将 DataGridView 中的图像显示到 PictureBox?)
WinForms 应用程序设计——将文档从 SQL Server 移动WinForms application design - moving documents from SQL Server to file storage(WinForms 应用程序设计——将文档从 SQL Server 移动到文件存