0

使用下表...如果我想用其他内容完全替换 xml 列的内容,替换(或删除/插入)会是什么样子...没有类似的节点但我需要 PK i保持原样

CREATE TABLE T (i int, x xml)
go
INSERT INTO T VALUES(1,'<Root>
<ProductDescription ProductID="1" ProductName="Road Bike">
<Features>
 <Warranty>1 year parts and labor</Warranty>enter code here
 <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
/Root>')
4

1 回答 1

0
update t
set x='<Root>
<ProductDescription ProductID="1" ProductName="Road Bike v2">
<Features>
<Warranty>1 year parts and labor</Warranty>enter code here
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
/Root>'
where i=1
于 2013-07-16T20:00:36.333 回答