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 Picture 1
Confirm the information to delete the selected database

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

Previous article: How to select a database in MS SQL Server

Next lesson: How to create a copy of data in MS SQL Server

5 ★ | 1 Vote

May be interested

  • What is MS SQL Server?What is MS SQL Server?
    this article will give you a general introduction to sql server, demonstrating the benefits and benefits of using sql server as well as existing versions.
  • DELETE command in SQL ServerDELETE command in SQL Server
    the delete statement in sql server (transact-sql) is used to delete one or more records from a table in sql server.
  • Network basics: Part 3 - DNS ServerNetwork basics: Part 3 - DNS Server
    a dns server is a server that contains a database of public ip addresses and hostnames associated with them. in most cases, the dns server is used to resolve or translate those common names into ip addresses as required.
  • How to Set Up a Microsoft SQL Server Database in Docker on LinuxHow to Set Up a Microsoft SQL Server Database in Docker on Linux
    traditionally, sql server databases were set up on dedicated servers or virtual machines, but docker has changed all that.
  • Microsoft Windows PowerShell and SQL Server 2005 SMO - Part 9Microsoft Windows PowerShell and SQL Server 2005 SMO - Part 9
    in part 9 of this series, i will show you how to use powershell in conjunction with smo to create a sql server script. creating sql server scripts is an important task for administrators and sql server database development professionals.
  • DELETE TOP command in SQL ServerDELETE TOP command in SQL Server
    the delete top command in sql server is used to delete records from a table in sql and limits the number of records based on an existing value or percentage.
  • Learn about the role concept in SQL ServerLearn about the role concept in SQL Server
    in any database management system, security and security are always top priority. and with sql server, if we take advantage of the many advantages of this application, those who manage the system administration will greatly reduce the burden as well as the pressure on the job.
  • Ways to log in database on MS SQL ServerWays to log in database on MS SQL Server
    below are instructions on how to log into the database on ms sql server.
  • Compare the performance of MongoDB and SQL Server 2008Compare the performance of MongoDB and SQL Server 2008
    in the following article, we will point out the difference in performance of the relatively new database management system, which is mongodb and one of the popular systems like sql server (mysql or oracle). most of the data is given here in the form of charts, so we can easily imagine the advantages and disadvantages of mongodb as well as other database management systems.
  • DROP TABLE command in SQL ServerDROP TABLE command in SQL Server
    in sql server, the drop table command is used to delete a table from the database.