DROP Table

Other topics

Remarks:

DROP TABLE removes the table definition from the schema along with the rows, indexes, permissions, and triggers.

Simple drop

Drop Table MyTable;

Check for existence before dropping

MySQL3.19
DROP TABLE IF EXISTS MyTable;
PostgreSQL8.x
DROP TABLE IF EXISTS MyTable;
SQL Server2005
If Exists(Select * From Information_Schema.Tables
          Where Table_Schema = 'dbo'
            And Table_Name = 'MyTable')
  Drop Table dbo.MyTable
SQLite3.0
DROP TABLE IF EXISTS MyTable;

Contributors

Topic Id: 1832

Example Ids: 5998,5999

This site is not affiliated with any of the contributors.