Update a SQL table’s XML value to insert a node

Sometimes a snippet of example code is all that’s needed:

update MyTable
   set XmlColumn.modify('       
      insert <Description>This is a description</Description>
      as last
      into (/xpath/to/parent)[1]       
   ')
   where SomeValue = 'whatever'
This entry was posted in CodeMinder, Programming, SQL, XML. Bookmark the permalink.