title: Update Empty XML Tag in SQL Server
body: <p>I'm trying to update an empty XML Tag in my Xml string on sql server; it says the row is updated when i run the following script, but when I view the XML; nothing has changed:</p>
  
  <pre><code>Declare @newValue varchar(100)
  select @newValue = '01'
  
      update dbo.UploadReport
      set XmlTest.insert('replace value of (/CodeFiveReport/Owner/AgencyID/text())[1] with sql:variable("@newValue")') 
      where id = 'myId'
  </code></pre>
  
  <p>The xml after still appears as this in the databse</p>
  
  <p><code>&lt;AgencyID /&gt;</code></p>
  
  <p>What am I doing wrong?</p>
  
  <p>I've tried @AgencyID without the text() at the end and still no avail...</p>