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

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

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