My application is based on a sql server db.
All customers has the same db except for customizations.
Some customizations include: new tables, modified tables, custom views, custom triggers…
When I run the software update some scripts are executed. Now I manually disable triggers and reenable after the scripts are done.
Anyway I would like automatically to disable all the triggers (that are enabled, may be some of them could be already disabled) and then reenable them at the end.
Not to reinvent the whell, how to do that?
How to get only the active triggers on the current db?
Once I got this I can programmatically create and run the
DISABLE TRIGGER triggername ON TABLENAME
ENABLE TRIGGER triggername ON TABLENAME
1 means true, 0 means false obviously
Use Jeff O’s query and modify it a bit
or add it as a where clause.