Question

I want to disable all Foreign key constraints and re-enable them after, is there some way to do that?

I know that SQLServer allows that, but what about Firebird?

Was it helpful?

Solution

AFAICT foreign keys can't be disabled in Firebird up to 2.1.
You'd have to drop and recreate them.
There's a similar thread on Devshed.

OTHER TIPS

I guess the only way is to drop and later re-create them. Since constraints are not data, you really do not lose any information from the database, so it is a harmless operation (provided that you keep the script to recreate them later).

Version of FlameRobin in SVN repository has an option to generate those DROP and CREATE scripts automatically for chosen table column dependencies. Last official release has the same option for entire tables, so that might help you. There is no option to do it for the whole database, though. Maybe some other admin. tool has that feature.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top