SQLTeam.com | Weblogs | Forums

XMLInsert


#1

I know i can insert a tag using
SET @x.modify('insert "FileSerialNumber fileserial="000000" /" into (/BACSDocument/Data/ARUDD/ReturnedDebitItem)[1]')

which inserts into the first instance of returneddebit item, but how can insert the tag on all instances


#2

SQL XML insert and update are rather limited in that way. You will get error something along the lines of "The target of modify must be a single node....".

More often than not, when I want to update an XML I shred it, make the changes and reassemble it.