Normally to find out whether or not a trigger is enabled/disabled, we can simply run this: SELECT OBJECTPROPERTYEX (OBJECT_ID(‘TriggerName’),’ExecIsTriggerDisabled’) A DDL trigger, however, is not schema-scoped, therefore the above query will return NULL. To find out, here’s the query that you need to run: SELECT name, is_disabled FROM sys.triggers WHERE name = ‘TriggerName’
Archive for November, 2009
How To Find Out If A DDL Trigger Is Enabled
Posted in SQL Server, tagged tips, trigger on 30 November 2009 | Leave a Comment »
How to Create An Empty Database
Posted in SQL Server, tagged schema on 4 November 2009 | Leave a Comment »
Not a new database, but an empty database – no data, but it still preserves the existing schema. You have choices: 1. Use a combination of Truncate/Delete USE MyDB EXEC sp_msforeachtable ‘print ‘’TRUNCATE TABLE ?’’’ The command will truncate all tables in the database, EXCEPT when a column in a table has a constraint such [...]