title: Sync two tables one way in the same database using stored procedure
body: <p>I've 2 identical tables, one will be updated and the other no, so I want to write stored procedure to check the updates for existing record in table 2 and if not exist to insert the record from table 1 to table 2.</p>
  
  <pre><code>Table 1
  
      | Field1 | Field2 | Field3 |
      | ------ | ------ | -----: |
      |  A     |  1     |   $10  |
      |  B     |  2     |   $20  |
      |  C     |  2     |   $21  |
  
  
  Table 2
  
      | Field1 | Field2 | Field3 |
      | ------ | ------ | -----: |
      |  A     |  3     |   $13  |
      |  B     |  2     |   $20  |
  </code></pre>
  
  <p>What the stored procedure will do in this sample, it'll update row (B) in Table 2 with the data in Table 1 and insert row (C) to Table 2.</p>