开发者

XML Insert attribute

开发者 https://www.devze.com 2023-03-06 17:33 出处:网络
When I update a开发者_开发知识库n xml column: SET XmlDocumentData.modify(\'insert attribute User {sql:variable(\"@User\")}

When I update a开发者_开发知识库n xml column:

SET XmlDocumentData.modify('insert attribute User {sql:variable("@User")} 
    as last into (/Configuration/Process/Tasks)[1] ')

I am getting an error:

Msg 6905, Level 16, State 3, Line 27 XML Validation: Attribute 'User' is not permitted in this context. Location: //@*:User

What is a way to add new attributes in every task?


I guess that the column XmlDocumentData is bound to a Schema Collection and that the User attribute is not allowed in the Tasks node. Keep in mind that XML is case sensitive.

0

精彩评论

暂无评论...
验证码 换一张
取 消