drop table

Description

Removes a table definition and all of its data, indexes, triggers, and permissions from the database.

Syntax

drop table [[database.]owner.]table_name 
	[, [[database.]owner.]table_name ] ...

Parameters

table_name

is the name of the table to drop. Specify the database name if the table is in another database, and specify the owner’s name if more than one table of that name exists in the database. The default value for owner is the current user, and the default value for database is the current database.

Examples

Example 1

Removes the table roysched and its data and indexes from the current database:

drop table roysched

Usage


Restrictions


Dropping tables with cross-database referential integrity constraints

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

drop table permission defaults to the table owner and is not transferable.

See also

Commands alter table, create table, delete, truncate table

System procedures sp_depends, sp_help, sp_spaceused