title: TRY CATCH in SQL Server
body: <p>I am using SQL Server 2008. I have tried to execute the following:</p>
  
  <pre><code>BEGIN TRY
      SELECT 1/0;
  END TRY
  BEGIN CATCH
      PRINT 'ERROR'
  END CATCH;
  </code></pre>
  
  <p>But I am getting the following error:</p>
  
  <pre><code>&gt;Msg 170, Level 15, State 1, Line 1
  Line 1: Incorrect syntax near 'TRY'.
  Msg 156, Level 15, State 1, Line 3
  Incorrect syntax near the keyword 'END'.
  </code></pre>
  
  <p>Can any one tell me how execute try catch in SQL Server?</p>