I was wondering if it is possible to enable a trigger just for my current application and not for any sql executed against the table.
The situation:
There are two applications working on the same database. App1 and App2.
I have a trigger on 'MyTable' which should only be fired when App1 is executing a query, but not when App2 is doing so.
APP_NAME()
, you can also useSET CONTEXT_INFO
.SET CONTEXT_INFO
is commonly used to send info to triggers like this. – Nick Chammas Jun 25 at 9:08