title: Using TABLOCK with merge SQL Server
body: <p>I have a merge query similar to the one below:</p>
  
  <pre><code>MERGE [Unshipped] u
  USING [Order] or ON or.ID = u.ID
  
  WHEN MATCHED AND u.Date &lt;&gt; or.Date
     THEN
        UPDATE 
        SET u.Date = or.Date
  
  WHEN NOT MATCHED
      THEN 
         INSERT (ID, FK, Date)
         VALUES (or.ID, or.FK, or.Date)
  </code></pre>
  
  <p>If i am to add TABLOCK where is the best place for it? I would have assumed i would put it like below - wrap the whole merge statement: </p>
  
  <pre><code>     MERGE [Unshipped] u WITH (TABLOCK)
       USING [Order] order or ON or.ID = u.ID
  </code></pre>
  
  <p>or is it more suitable for it to go with the insert statement?</p>