title: Is TABLOCK, HOLDLOCK enough to prevent INSERT?
body: <p>I have a transaction including several tables. I need to prevent inserts  to  <code>TABLE_TO_BE_LOCKED</code> after I have deleted some records from <code>EDITED_TABLE</code>. Currently I am using <code>TABLOCKX</code></p>
  
  <pre><code>DELETE EDITED_TABLE FROM EDITED_TABLE
  left join TABLE_TO_BE_LOCKED  with (TABLOCKX) on ....
   WHERE ...
  </code></pre>
  
  <p>I need to prevent inserting new records to <code>TABLE_TO_BE_LOCKED</code> but I would like to preserve possibility to read it. After the <code>DELETE</code> <code>TABLE_TO_BE_LOCKED</code> is still not changed and this is the reason for explicit locking.</p>
  
  <p>Can I use <code>TABLOCK, HOLDLOCK</code> instead of <code>TABLOCKX</code>? </p>
  
  <p>Note:</p>
  
  <p>I know about <a href="https://stackoverflow.com/questions/2522286/how-to-lock-a-table-for-inserting-in-sql">How to lock a table for inserting in sql?</a>. However there is result don't do it to prevent duplicities in primary key. </p>