Trigger Error

  • Hi everybody!

    I have an insert/update trigger and I notice that when the trigger encounters an error the whole initial insert or update is failing. How can I prevent this from happening?

    Thanks a lot,

    Durug

  • Another question related to my problem: when an updated is issued (for just one field - the table has 5) the inserted logical table will contain all fields or only the one is waiting to be updated?

    Thanks

  • #1 - You need to figure out why it is erroring, and code the trigger to handle it without generating that error. Otherwise the error will cause the implicit transaction to rollback.

    #2 - The inserted table is an exact copy the table being inserted/updated. So, yes, all columns are there whether they are updated or not.

    There's a lot to be aware of when programming triggers. Read up on them in BOL.

    Jay Madren


    Jay Madren

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

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