xml-dml

TSQL 2005, XML DML - Update Two Values at once?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 01:05:15
Is there any way to combine these two replace values with 1 update statement? UPDATE dbo.MyTable SET MyXmlColumn.modify('replace value of (/node/@att1)[1] with "1"') WHERE id = 1 UPDATE dbo.MyTable SET MyXmlColumn.modify('replace value of (/node/@att2)[1] with "2"') WHERE id = 1 http://msdn.microsoft.com/en-US/library/ms190675(v=SQL.90).aspx harvest316 I dont think you're in luck, Thx. I tried several syntactical variants with no joy. For example, the obvious: SET MyXmlColumn.modify('...'), MyXmlColumn.modify('...') yields: The column name 'MyXmlColumn' is specified more than once in the SET

TSQL 2005, XML DML - Update Two Values at once?

佐手、 提交于 2019-11-26 23:28:19
问题 Is there any way to combine these two replace values with 1 update statement? UPDATE dbo.MyTable SET MyXmlColumn.modify('replace value of (/node/@att1)[1] with "1"') WHERE id = 1 UPDATE dbo.MyTable SET MyXmlColumn.modify('replace value of (/node/@att2)[1] with "2"') WHERE id = 1 http://msdn.microsoft.com/en-US/library/ms190675(v=SQL.90).aspx 回答1: I dont think you're in luck, Thx. I tried several syntactical variants with no joy. For example, the obvious: SET MyXmlColumn.modify('...'),