title: Inserted and Deleted trigger about changeable primary key (SQL Server)
body: <p>Suppose I have a table with one column (is primary key) and I have trigger on that table to log any changes. Now when update a row (primary key) in Deleted I have old primary value and in Inserted I have new primary value. In multiple row update how can I tied old value (in Deleted) to new value (in Inserted)?</p>
  
  <p>e.g:</p>
  
  <p>myTable with one column (also is primary key):</p>
  
  <pre><code>PK
  ---
  1
  2
  </code></pre>
  
  <p>Now I update 1 to 4 and 2 to 3</p>
  
  <pre><code>Deleted
  -------
  1
  2
  
  Inserted
  --------
  3
  4
  </code></pre>
  
  <p>how can I log these changes in audit table that has three column: PK, old_value, new_value</p>
  
  <pre><code>Audit Table
  -----------
  PK | old_value | new_value
  1  | 1         | 4
  2  | 2         | 3
  </code></pre>
  
  <p>in oracle we have old and new value but in sql server no.</p>