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

> Thanks for the suggestion.
> Absolutely nothing is wrong with it when working with one or two
> triggers. My problem is that there are lots of tables that have foreign
> keys pointing to this table with cascading delete or set null rules for
> deletion, which is going to obviously fire the before / after update or
> delete triggers on those tables.
> I started doing it this way but it gets a bit messy. Deleting this
> table effectively "empties" the database of all the data that is
> important.
> Anyhow the script does work and reduces the time to about 20 seconds to
> delete 20000 records which is pretty good for my crappy old box. I was
> just wondering if there was a better way to disable "all" triggers
> while "emptying" my database here.

You can easily get a list of available triggers via RDB$TRIGGERS.

btw, you can also choose to do a DELETE <childtable> first :-)

With regards,

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