4D v16

ALTER DATABASE

Home

 
4D v16
ALTER DATABASE

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

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: SQL Commands

 
GESCHICHTE 

 
ARTIKELVERWENDUNG

4D - SQL Reference ( 4D v16)