title: XML columns compare in SQL Server
body: <p>I have got 3 columns:</p>
  <ol>
  <li>[OldContent] [xml] NULL</li>
  <li>[NewContent] [xml] NULL</li>
  <li>[OldContent] [xml] NULL</li>
  </ol>
  <p>I want to compare the data in two columns. I want to write the results into the third column (<code>[OldContent]</code>)</p>
  <p>How can I do it in SQL Server?</p>
  <p>[OldContent] [xml] NULL, in</p>
  <p>Value</p>
  <pre><code>&lt;row GUEST_ID=&quot;13&quot; GUEST_NAME=&quot;VEDAT&quot; GUEST_SURNAME=&quot;PALA&quot; ADRESS=&quot;IZMIR&quot; /&gt;
  </code></pre>
  <p>[NewContent] [xml] NULL, in value</p>
  <pre><code>&lt;row GUEST_ID=&quot;13&quot; GUEST_NAME=&quot;VEDAT35&quot; GUEST_SURNAME=&quot;PALA&quot; ADRESS=&quot;IZMIR&quot; CITY=&quot;DR&quot; CITY_CODE=&quot;35&quot; /&gt;
  </code></pre>
  <p>I want to write the value in it.</p>
  <pre><code>[UpdateContent] [xml] NULL
  
  &lt;row GUEST_NAME=&quot;VEDAT35 CITY=&quot;DR&quot; CITY_CODE=&quot;35&quot; /&gt;
  </code></pre>
  <p>I need a procedure to compare XML column values.</p>
  <p><a href="https://i.stack.imgur.com/QkvMr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QkvMr.jpg" alt="" /></a></p>
  
  <p><a href="https://i.stack.imgur.com/MYFq3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MYFq3.jpg" alt="" /></a></p>