尝试以下代码.但是获取'xml数据类型方法的参数1"修改"必须是字符串文字'错误.搜索了很多,但无法找到解决此问题的任何方法
SET @Path = '/@ParentNodeName/@NodeName/child::*'
SET @x.modify('insert attribute status {sql:variable("@status")}
as first into (' + @Path + ')[1]')
Run Code Online (Sandbox Code Playgroud)