| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
DROP TABLE Syntax
DROP [TEMPORARY] TABLE [IF EXISTS] tbl_name [, tbl_name,...] [RESTRICT | CASCADE] |
DROP TABLE removes one or more tables. All table data and the table
definition are removed, so be careful with this command!
In MySQL Version 3.22 or later, you can use the keywords
IF EXISTS to prevent an error from occurring for tables that don't
exist. In 4.1 one gets a NOTE for all not existing tables when using
IF EXISTS. See section 13.5.3.9 SHOW WARNINGS | ERRORS.
RESTRICT and CASCADE are allowed to make porting easier.
For the moment they don't do anything.
Note: DROP TABLE automatically commits the current
active transaction (except if you are using 4.1 and the TEMPORARY
key word.
Option TEMPORARY is ignored in 4.0. In 4.1 this option works as
follows:
Using TEMPORARY is a good way to ensure that you don't accidently
drop a real table.