Delete Database in SQL Server

In SQL, we can drop or delete a database either by using the “DROP DATABASE” statement or directly from SQL Server Management Studio. We can delete a database based on our requirements.

SQL Drop Database Statement

Using the “DROP Database” statement, we can drop or delete the SQL database. Generally, our syntax will be as shown below to drop the database in SQL.

SQL Drop Database Syntax

Following is the syntax to drop or delete the existing database in SQL using the DROP DATABASE statement.

 

DROP DATABASE databasename

 Here databasename is the name of the database to drop or delete from SQL Server.

SQL Drop Database Example

Following is the example query to delete or drop the existing database “sqltutorialexamples” in the SQL server.

 

DROP DATABASE sqltutorialexamples

To drop a database, you must have admin access rights and refresh your database section once you execute the above query to check whether the database was deleted from your list or not.

SQL Drop Database using SQL Server Management Studio

To delete a database from SQL Server, open SQL Server Management Studio à Select your database in the Databases section à Right-click and select DELETE Option as shown below.

 

Drop or Delete Database in SQL Server using Management Studio

 

Whenever we click on Delete Option, a new Delete Modal object window will open in that click on OK to drop or delete a database in SQL server like as shown below. 

 

Delete Database in SQL Server using Management Studio

 

 Once the process is finished, then refresh your databases section and check whether your database was deleted or not in the SQL server.