It is simple ... I don't think you can't do it (in SQL).
Transactions in a trigger participate in the open transaction, so you roll
back the outer one you rollback the inner one.
You can invoke an extended (xp_) procedure in the trigger to write a log
outside of the outer transaction.
XP's are really just an call to an external program that runs outside of the
sqlserver (as well as outside the transaction).
If you can't write your own XP DLL , you can invoke an EXE via the standard
xp_cmdshell.
XP's may be turned off for security reasons.
Also since an errant XP could lock up the database server (requireing a
reboot), they should be used with care.
"Andy" <an*********@hotmail.com> wrote in message
news:8f**************************@posting.google.c om...
Dear all,
I have created some triggers on tables for audit purposes. I want this
process to be outside of the existing transaction for the application
making the changes to the tables. - if for whatever reason an insert
into the audit tables fails, I do not want the calling application to
fail!
How is this done in TSQL?
This is bound to be simple but its eluding me so far...
Many thanks in advance.
Andy