I have a column in sql database with type XML. I want to add a new node EFDRow
with same value in all nodes with name GoodsSerial
.
<Serials>
<GoodsSerial>
<GSerialSCredit>2015/08/11</GSerialSCredit>
<GSerialECredit>2015/08/11</GSerialECredit>
<GSerialStart>1</GSerialStart>
<GSerialEnd>5</GSerialEnd>
</GoodsSerial>
<GoodsSerial>
<GSerialSCredit>2015/08/11</GSerialSCredit>
<GSerialECredit>2015/08/11</GSerialECredit>
<GSerialStart>10</GSerialStart>
<GSerialEnd>15</GSerialEnd>
</GoodsSerial>
</Serials>
I have tried this Code
UPDATE Tbl
SET SerialXml.modify('insert <EFDRow>{sql:column("EFDRow")}</EFDRow> into (/Serials/GoodsSerial)[1]')
But it adds the EFDRow node only to first GoodsSerial node.