DROP TABLE (SQL Server Compact)

Removes a table definition and all data, indexes, constraints, and permission specifications for that table.

Syntax

DROP TABLE < table_name >

Arguments

  • table_name
    Specifies the name of the table to be removed.

Remarks

DROP TABLE cannot be used to drop a table referenced by a FOREIGN KEY constraint. The referencing FOREIGN KEY constraint or the referencing table must be dropped first.

When a table is dropped, rules or defaults on it lose their binding, and any constraints associated with it are automatically dropped. If you re-create a table, you must rebind the appropriate rules and defaults, and add all necessary constraints.

You cannot use the DROP TABLE statement on system tables.

Example

The following example creates and then drops the table from the database.

CREATE TABLE titles1 (title_id int);
DROP TABLE titles1;