This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||
|
4D v20 R7
ALTER DATABASE
|
ALTER DATABASE {ENABLE | DISABLE} {INDEXES | CONSTRAINTS | TRIGGERS} |
||
The ALTER DATABASE command enables or disables SQL options of the current database for the current session, i.e. for all users and processes until the database is restarted.
This command is intended to allow you to temporarily disable SQL options in order to accelerate certain operations that take up a lot of resources. For example, disabling indexes, constraints and triggers before beginning the import of a large quantity of data can significantly reduce the duration of the import.
Note that constraints include primary keys and foreign keys as well as unique and null attributes.
If you want to manage triggers individually for each table, you must use ALTER TABLE.
Example of an import with temporary disabling of all SQL options:
Begin SQL
ALTER DATABASE DISABLE INDEXES;
ALTER DATABASE DISABLE CONSTRAINTS;
ALTER DATABASE DISABLE TRIGGERS;
End SQL
SQL EXECUTE SCRIPT("C:\\Exported_data\\Export.sql";SQL On error continue)
Begin SQL
ALTER DATABASE ENABLE INDEXES;
ALTER DATABASE ENABLE CONSTRAINTS;
ALTER DATABASE ENABLE TRIGGERS;
End SQL
Product: 4D
Theme: SQL Commands
4D SQL Reference ( 4D v20 R7)