title: Delete and Insert Inside one Transaction SQL
body: <p>I just want to ask if it is always the first query will be executed when encapsulate to a transaction? for example i got 500 k records to be deleted and 500 k to be inserted, is there a possibility of locking?
  Actually I already test this query and it works fine but i want to make sure if my assumption is correct.</p>
  
  <p>Note: this will Delete and Insert the same record with possible update on other columns.</p>
  
  <pre><code>BEGIN TRAN;
      DELETE FROM OUTPUT TABLE WHERE ID = (1,2,3,4 etc)
      INSERT INTO OUTPUT TABLE Values (1,2,3,4 etc) 
  COMMIT TRAN;
  </code></pre>