title: Update SQL Server table based on values in a column
body: <p>I have 11 tables in my SQL Server database in which have the same columns, 10 are sub tables and 1 is the main table where the data in 10 tables will be merged. The 10 tables are constantly updating from time to time, below is the column that my 11 tables has:</p>
  
  <pre><code>[DATE], [SOURCE], [DESTINATION], [REFERENCE#], [ITEMCODE], [DESCRIPTION],
  [UM], [PRICE], [QTY], [AMOUNT], [MFGDATE], [EXPDATE], [LOT#], [TRANS], [CONSIGNOR], [DRDATE]
  </code></pre>
  
  <p>When a user updates a table, i.e <code>Table1</code>, the main table should automatically bee updated based on the <code>SOURCE</code> and <code>DESTINATION</code> columns. I know that there is the <code>Merge</code> statement, where you can update, insert and delete all at the same time, but my problem with that is the delete, since <code>Table1</code> will only have partial data compared to the main table, it will delete the rest of the data in main table that is not present in the <code>Table1</code>.</p>
  
  <p>I am new to SQL Server and I can't pull this off by myself, that's why I am here looking for ideas and some help too.</p>