Why does Sql Server keep executing after raiserror when xact_abort is on?

This is By DesignTM, as you can see on Connect by the SQL Server team’s response to a similar question:

Thank you for your feedback. By design, the XACT_ABORT set option does not impact the behavior of the RAISERROR statement. We will consider your feedback to modify this behavior for a future release of SQL Server.

Yes, this is a bit of an issue for some who hoped RAISERROR with a high severity (like 16) would be the same as an SQL execution error – it’s not.

Your workaround is just about what you need to do, and using an explicit transaction doesn’t have any effect on the behavior you want to change.

Leave a Comment