/* Oracle */
-- Disable All Triggers
BEGIN FOR REC IN (select table_name from user_triggers) LOOP execute immediate 'alter table '|| REC.table_name ||' disable all triggers'; END LOOP; END;-- Enable All Triggers
BEGIN FOR REC IN (select table_name from user_triggers) LOOP execute immediate 'alter table '|| REC.table_name ||' enable all triggers'; END LOOP; END;/* SQL Server 2005 */
-- Disable All TriggersDISABLE TRIGGER ALL ON DATABASE
-- Enable All Triggers
ENABLE TRIGGER ALL ON DATABASE
/* SQL Server 2000 */
-- Disable All TriggersEXEC sp_MSforeachtable @command1 = 'ALTER TABLE ? DISABLE TRIGGER ALL'
-- Enable All Triggers
EXEC sp_MSforeachtable @command1 = 'ALTER TABLE ? ENABLE TRIGGER ALL'
-- Enjoy!
No comments:
Post a Comment