Due to the way triggers are implemented in SQL Server , all violations of restrictions in triggers doom transactions.
This is the same as doing:
DROP TABLE test CREATE TABLE test ( a INT NOT NULL ) GO SET XACT_ABORT ON GO BEGIN TRANSACTION BEGIN TRY INSERT INTO test SELECT NULL END TRY BEGIN CATCH INSERT INTO test SELECT 1 END CATCH
which leads to a doomed transaction, except that inside the trigger there is no way to disable XACT_ABORT .
SQL Server also lacks offline transactions.
This is another reason why you should put all the logic in stored procedures, not triggers.
Quassnoi
source share