Subject Re: [firebird-support] Disabling triggers
Author Martijn Tonies
Hello Adam,

> We are doing some testing at the moment with a fair chunk of data. We
> need to empty a table containing lots of records. To make it even
> worse, there are 4 or 5 other tables that reference that table by a
> foreign key (on delete cascade), and nearly all of them have deletion
> triggers that will in turn update other tables. So:
> delete from MyTable;
> works but takes the better part of 10 minutes because of the domino
> effect.
> I would like to temporarily disable the triggers on this table (which
> is what is making it take so long).
> Looking through the system tables, it looks like the following code
> should turn off all the triggers, but leave in place the check
> constraints and foreign keys etc.
> where RDB$TRIGGER_SOURCE is not null;
> Is there any danger in doing this? (apart from database consistency if
> the triggers do not run) This is only to help speed up testing, not
> including it in a release.

What's wrong with ALTER TRIGGER <name> INACTIVE;

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions