且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从SQL Server中的XML中删除多个节点

更新时间:2022-06-11 06:16:57

这是'删除'的方式:

This is the 'delete' way:
SET @XML.modify('delete /my/Fields/Fields_1')



原因是 modify 无法仅获取文字的变量。 ..

您可以创建当然动态SQL ...

sp_executesql(Transact-SQL)| Microsoft Docs [ ^ ]


The reason is that modify can not get variables only literal...
You can create of course dynamic SQL...
sp_executesql (Transact-SQL) | Microsoft Docs[^]