title: Using MERGE in SQL Server 2012 to insert/update data
body: <p>I am using SQL Server 2012 and have two tables with identical structure. I want to insert new records from table 1 to table 2 if they don't already exist in table 2. </p>
  
  <p>If they already exist, I want to update all of the existing records in table 2. </p>
  
  <p>There are some 30 columns in my tables and I want to update all of them. </p>
  
  <p>Can someone please help with this? I had a look at various links posted over internet, but quite don't understand how my statement should look like.</p>