Ignore an error in a trigger

  • An application is inserting a row of data, I am extracting some of the data via an After Insert Trigger.

    When there is an error in my trigger, the error is returned to the insert caller and the transaction is rolled back.

    I added a commit statement at the beginning, that solves the rollback problem, but the error is still reported back to the application which causes it to disconnect.

    I cannot change the application.

    I have searched and tried different things with Try/Catch, but have not had any success.

    Anyone have any recommendations for this SQL novice? :exclamationmark:

    Thanks

  • my recommendation is to simply fix the trigger so you don't have to work around your errors; we can certainly help and offer advice and testable scripted solutions.

    paste the trigger here so we can see it and offer some advice.

    there are certain methods you want to always use in a trigger (such as assuming more than one row is being processed, and not following that format can lead to errors like you are describing.)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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