The SQL Server DROP TABLE statement serves to drop the table from the database. This article will explain some use scenarios and illustrate the work of the DROP TABLE statement by examples.

For demonstration, we are using the wideworldimportors demo database – you can download it from here.

The syntax of the DROP TABLE statement is as follows:

Drop table [Database_name].[Schema_name].[table_name]
  • Database_name: the name of the database from which you want to delete the table.
  • Schema_Name: the name of the schema for which the table exists. If you have created the table in the DBO schema, we can skip this parameter. If the table is created in a non-default schema, we must specify the name of the schema name.
  • Table_Name: the name of the table you want to delete.

#sql server #sql drop table #sql

Understanding DROP TABLE Statement in SQL Server
1.10 GEEK