I just got surprised by something in TSQL. I thought that if xact_abort was on, calling something like
raiserror(\'Something bad happened\', 16, 1);
As pointed out on the docs for SET XACT_ABORT, the THROW statement should be used instead of RAISERROR.
THROW
RAISERROR
The two behave slightly differently. But when XACT_ABORT is set to ON, then you should always use the THROW command.
XACT_ABORT