I am trying to test result when ARITHABORT and ANSI_WARINGS are ON in Compatibility level 80 and Compatibility level 140. I use TRY - CATCH to catch domain errors too. The result is different in two level. In compatibility level 80, error conditions cause the query to end and CATCH clause is not executed. In compatibility level 140, error conditions cause the query to end and CATCH clause is executed.
Can you explain why have different in two compatibility level?
This is my code:
SET ARITHABORT ON SET ANSI_WARNINGS ON BEGIN TRY SELECT SQRT(-1) PRINT N'OSQL Success' END TRY BEGIN CATCH PRINT N'OSQL Failure' END CATCH