title: How to Merging two DataTables in third table using stored procedure in SQL Server?
body: <p><strong>Table1</strong></p>
  
  <pre><code>-----------------------------
  Id      | Batch    |   Qty
  -----------------------------
     1       A1         5     
     2       A2         5      
     3       A3         5    
     4       A4         5
  </code></pre>
  
  <p><strong>Table2</strong></p>
  
  <pre><code>-----------------------------
  Id     | Batch  | Qty
  ------------------- ----------
  1         A1        6    
  2         A2        6    
  3         A3        6     
  5         A5       10
  </code></pre>
  
  <p><strong>Expected result</strong></p>
  
  <pre><code>-----------------------------
  Id     | Batch  | Qty
  -----------------------------    
  1         A1       6 (Qty updated)    
  2         A2       6 (Qty updated)    
  3         A3       6 (Qty updated)    
  4         A4       5 (remains as same)    
  5         A5       10 (row in table 2)
  </code></pre>
  
  <p>How can I achieve this in SQL Server? If anybody knows this data table operation please share..</p>