Database Transaction usage, Database Transaction
SET XACT_ABORT
When a running error occurs in a Transact-SQL statement®SQL Server™Whether to automatically roll back the current transaction.
Syntax
SET XACT_ABORT {ON | OFF}
Note
When SET XACT_ABORT is ON, if a running error occurs in a Transact-SQL statement, the entire transaction is terminated and rolled back. When it is OFF, only the wrong Transact-SQL statement is returned, and the transaction will continue to be processed. Compilation errors (such as syntax errors) are not affected by SET XACT_ABORT.
For most ole db providers (including SQL Server), XACT_ABORT must be set to ON for data modification statements in implicit or explicit transactions. The only case where this option is not required is when the Provider supports nested transactions. For more information, see distributed queries and distributed transactions.
SET XACT_ABORT is SET during execution or running, rather than during analysis.