Computer >> Computer tutorials >  >> Programming >> SQL Server

How to delete the database in MS SQL Server

To delete the database in MS SQL Server, we use the DROP command . Here are 2 ways to use this command.

Method 1: Use T-SQL Script

Here is the syntax to delete the database in MS SQL Server.

 Drop database 

For example, to delete a CSLD named Testdb, you run the query

 Drop database Testdb 

Method 2: Use MS SQL Server Management Studio

Connect to SQL Server and right click on the database you want to delete. Select delete and the following screen will appear.

How to delete the database in MS SQL Server
Confirm the information to delete the selected database

Select OK to delete the selected database ( Testdb in this example ) from MS SQL Server.