title: Do I need to use a try..catch block, and explicit rollback in a SQL Server procedure?
body: <p>If I am coding a SQL Server (2008r2) procedure, and I wrap it in a transaction, do I need to explicitly enclose it in a try..catch block, and then explicitly call rollback in the catch block, or will it exit and rollback the same on its own?</p>
  
  <p>i.e.:</p>
  
  <p>How does this:</p>
  
  <pre><code>    begin transaction
  
      begin try
      delete from....
  
      insert into...
      end try
      begin catch
      rollback transaction
      return
      end catch
  
      commit transaction
  </code></pre>
  
  <p>Compare with:</p>
  
  <pre><code>    begin transaction
      delete from....
  
      insert into...
      commit transaction
  </code></pre>
  
  <p>Thank you for any help.</p>