title: Why does T-SQL not stop on errors
body: <p>If I do the following query</p>
  
  <pre><code>EXEC spFoo
  PRINT 'TEST'
  </code></pre>
  
  <p>and <code>spFoo</code> throws an error, it still executes the print statement.</p>
  
  <p>However if I do</p>
  
  <pre><code>BEGIN TRY
      EXEC cdb.spFoo
      PRINT 'TEST'
  END TRY
  BEGIN CATCH
      THROW;
  END CATCH
  </code></pre>
  
  <p>It behaves as I expected and does not continue after an error.</p>
  
  <p>Could someone please explain this behaviour for me? It still continues on even if I encapsulate it in a transaction. It is not just the with a print-statement but also with any other thing. My initial thought was that it was a severity problem but the severity was level 16. Is this normal T-SQL behaviour? If so, what motivates this design that contradicts every other language I have ever worked with that directly escalates the error?</p>
  
  <p>I have tried and seen the same behaviour in SQL Server 2012, 2014 and 2017 across several different machines. The stored procedure in question is linked to a SQL CLR.</p>