title: RETURN inside a transaction with TRY-CATCH block
body: <p>I have the following code, and I am wondering, as a generic example, if the transaction is left open if it exits with <code>RETURN</code>. </p>
  
  <pre><code>BEGIN TRANSACTION
      BEGIN TRY
          IF NOT EXISTS(SELECT 1 FROM dbo.tblProducts WHERE intProductID = @intProductID)
              BEGIN
                  SELECT 'Product does not exists' AS strMessage
                  RETURN
              END
  
          UPDATE dbo.tblProducts SET
              curPrice = 10
          WHERE
              intProductID = @intProductID
  
          SELECT 'Success' AS strMessage
  
      END TRY 
  
      BEGIN CATCH
          SELECT ERROR_MESSAGE() AS strMessage
          IF @@TRANCOUNT &gt; 0
              ROLLBACK TRANSACTION
      END CATCH
  
  IF @@TRANCOUNT &gt; 0
      COMMIT TRANSACTION
  </code></pre>