How to jump over a trigger [message #194702] |
Sun, 24 September 2006 09:31 |
mjschwenger
Messages: 137 Registered: July 2005 Location: US
|
Senior Member |
|
|
I have a trigger that is on a base production table - very simple logic: Create trigger on Base table for insert -> insert into audit table * from inserted. OK, but the audit table belongs to other department I cannot make any changes. It is truncated in the night, but in the day some other applications are writing, locking tha tbale, etc. fun stuff, and I end up into situation that my trigger fails (I lose transactions that I need) because the insert into the audit table fails. Is there a way to catch an error and if this insert fails and just to commit my own transaction. I know that the trigger is a transaction by itself. I tried several ways but all I tried fails... Any work around?
Any idea is apprecited.
Thanks lot, mj
|
|
|
|
Re: How to jump over a trigger [message #194978 is a reply to message #194711] |
Tue, 26 September 2006 06:46 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Sounds like you need an Exception block in the trigger to catch any errors, and prevent them from propogating and causing the transaction to fail.
|
|
|