title: TSQL: How can I update the value of an xml tag with the value of an xml tag from another related table?
body: <p>How can I update the value of an xml tag with the value of an xml tag from another related table?</p>
  
  <p>something like this:</p>
  
  <pre><code>UPDATE v2
   SET
   [xml].modify ('replace value of (//TAG1/text())[1] 
                  with "CAST(v1.[xml].query(''//TAG2'') AS NVARCHAR(MAX))"')
  FROM 
   table2 v2, 
   table1 v1 
  WHERE
   v2.id = v1.id
  </code></pre>