Following on from this thread I have found an odd behaviour. Most of the tests in this thread were done using the AETL Run SQL tab and simply
calling a stored procedure (and getting the expected results).
However, I have found a scenario where the results always return positive and the errors thrown seem to be absorbed somewhere.
I have a basic stored procedure with a TRY/CATCH block that I have reduced down to the necessary elements for this thread.
If I execute this from SSMS it runs as expected and an error is thrown back to the caller. NOTE that there is an INSERT statement just before
the THROW. This is so that the error can be logged. In reality the true script would be updating a table row indicating that an error occur whilst
actioning ETL for the row.
All Good...
However, I found that AETL was not showing the error even though it is in the USER Range (50000+) and more importantly has a severity between 11-17
This one is 16. Therefore, SQL Server considers this as a fatality and AETL should indicate the call has failed. But as you can see it considers it to be Ok.
IF I REMOVE THE INSERT Statement before the THROW. It fails as expected AND AETL senses that it has failed.
Any Ideas?
I have included the sample SQL Script.