I need a way to audit when someone tries to either activate or disable a trigger in our database. The DDL launch alternative works fine, but only if the user uses
ALTER TABLE <tableName> ENABLE TRIGGER <triggerName>
OR
ALTER TABLE <tableName> DISABLE TRIGGER <triggerName>
statement. From what I determined, the DDL method becomes useless if the user executes the following instructions that bypass the ALTER command:
DISABLE TRIGGER <triggerName> ON <tableName> ENABLE TRIGGER <triggerName> ON <tableName>
I had several thoughts about capturing these events; none of them work. One of them was, if I could access the table underlying the sys.triggers view, I could place the insert / update trigger in that table and filter the trigger name to get the audit; but my suspicion is that this is likely to lead to infinite recursion, even if it were possible.
Does anyone have any possible suggestions for alternative solutions to this problem? I do not understand why MS would allow extended versions of operators to avoid audit coverage. That is, an audit of the simplest methods; using the SQL profiler seems to be superfluous for this.
source share