gpt4 book ai didi

sql - 修改SQL Server中的xml元素名称

转载 作者:数据小太阳 更新时间:2023-10-29 01:58:23 29 4
gpt4 key购买 nike

我想用以下语句更改元素名称:

SET @myDoc.modify('replace value of (/CustomerInfo)[1] with "Customer"')   

来自
<客户信息>
1
客户信息>

<客户>
1
客户>
但是失败了。那么我怎样才能在 sql 中更改它呢?

最佳答案

我试过以下 sql:
选择@myDoc=(
选择@myDoc.query('/CustomerInfo/node()')
对于 xml raw('Customer'),type)
我想它可以解决您的问题。

关于sql - 修改SQL Server中的xml元素名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/886073/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com