Transactions

When a user transaction is not active, a trigger and the DML operation that fired it are considered a single transaction. This holds for any stored procedures or UDFs the trigger calls—everything runs from within the same transaction.

When a trigger generates a fatal error or executes ROLLBACK TRANSACTION, the currently active transaction is rolled back and the current command batch is terminated. If this transaction is a user transaction, all changes made in that transaction are discarded. If it is the default transaction that's created anytime a data modification occurs, only the changes made by that one operation are lost.

For INSERT operations, the inserted logical table lists the rows being appended to the table. For DELETE ...

Get Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.