title: when/what locks are hold/released in READ COMMITTED isolation level
body: <p>I am trying to understand isolation/locks in SQL Server.</p>
  
  <p>I have following scenario in READ COMMITTED isolation level(Default)</p>
  
  <p>We have a table.</p>
  
  <pre><code>create table Transactions(Tid int,amt int)
  
  with some records
  
  insert into Transactions values(1, 100)
  insert into Transactions values(2, -50)
  insert into Transactions values(3, 100)
  insert into Transactions values(4, -100)
  insert into Transactions values(5, 200)
  </code></pre>
  
  <p>Now from msdn i understood </p>
  
  <p>When a select is fired <strong>shared lock</strong> is taken so no other transaction can modify data(avoiding dirty read).. Documentation also talks about row level, page level, table level lock. I thought of following scenarion</p>
  
  <pre><code>Begin Transaction
  
  select * from Transactions
  
  /*
  some buisness logic which takes 5 minutes
  
  */
  
  Commit
  </code></pre>
  
  <p>What I want to understand is for what duration of time shared lock would be acquired and which (row, page, table).</p>
  
  <p>Will lock will be acquire only when statement <code>select * from Transactions</code> is run or would it be acquire for whole 5+ minutes till we reach COMMIT.   </p>