Triggers and the effect

  • My question is this, if a trigger is written with an update, insert or delete, and it fails whether by powerfailure or other means prior to the commit statement ,and no rollback is coded into the trigger, what would the results be? Could you email the answer to me at mfreeze@state.pa.us. I assume that the results of the update, delete, insert statement would cause corruption or partially changed data. Or would it revert to its prior state because the commit had never been reached?Thanks.--Matt

  • "I assume that the results of the update, delete, insert statement would cause corruption or partially changed data."  It could if the cause of the crash were a disk drive failure.

    If not due to a disk drive failure, then it would revert to its prior state because the commit had never been reached.

    To see this recovery in action, look in the SQL Server log for these messages that occur during startup:

    ## transactions rolled forward in database '<dbname>' (#).

    and/or

    ## transactions rolled back in database '<dbname>' (#).

    SQL = Scarcely Qualifies as a Language

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

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