Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Handling with a trigger

Status
Not open for further replies.

ptmcs

Technical User
Joined
Oct 1, 2004
Messages
38
Location
GB
Hi,

I'm looking for any ideas on a scenario I have with a trigger...

We have a 3rd party application which we cannot access any code - I have written a trigger which generates some dynamic SQL, which is executed later, based on data inserted to a particular table - seems a reasonably safe way to do things without interfering with the 3rd party app,

However! if the trigger should fail - I would like it to handle the error in such a way whereby I can write data to a 'errorlog' table - but return from the trigger as if all had worked ok so it does not upset the 3rd party app.

Any suggestions? Many thanks in advance.....
 
Try checking the error code after each statement in your trigger. If it has been set to anything, then write to your error log, otherwise continue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top