DROP TABLE

4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next

version 11


DROP TABLE [IF EXISTS] sql_name

Description

The DROP TABLE command is used to remove the table named sql_name from a database. When the IF EXISTS constraint is passed, if the table to be removed does not exist in the database, the command does nothing and no error is generated.

This command not only removes the table structure, but also its data and any indexes, triggers and constraints that are associated with it. It cannot be used on a table that is referenced by a FOREIGN KEY constraint.

Examples

1. Here is a simple example which removes the ACTOR_FANS table:

   DROP TABLE ACTOR_FANS

2. This example does the same as the one above except that in this case, if the ACTOR_FANS table does not exist, no error is generated:

   DROP TABLE IF EXISTS ACTOR_FANS

See Also

ALTER TABLE, CREATE TABLE.


4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next