Trigger fails - avoid rollback of insert statement

  • Hi,

    if an AFTER trigger on an INSERT statement fails for some reason in SQL Server 2005, the complete INSERT statement is rolled back. Is this right?

    Is there some way to ensure that the INSERT statement is committed and only the statements in the trigger are rolled back?

    Best regards,

    jo

  • "Is there some way to ensure that the INSERT statement is committed and only the statements in the trigger are rolled back?"

    It depends on the statement in the trigger:

    1. Failure of an insert, update or delete will always rollback everything.

    2. A rollback will rollback everthing

    3. A raiserror will not rollback anything.

    SQL = Scarcely Qualifies as a Language

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply