I have some application code that runs transactions on my database - this then fires triggers that run audit information on secondary tables. I also have application code running on the audit tables.
Does anyone know how I can then write a trigger on the secondary table that detects whether the insert is run from the trigger or the application? Is there a system table that can tell me this? I have tried sysprocesses, systransactions and syslogshold - no joy. Any ideas?