---
title: "How to rename and drop a Database form SQL Server using command and Management Studio?"  
description: "How to rename and drop a Database form SQL Server using command and Management Studio?"  
author: "Ethan Karla"  
published: 2021-09-14  
canonical: https://answers.mindstick.com/qa/93946/how-to-rename-and-drop-a-database-form-sql-server-using-command-and-management-studio  
category: "database"  
tags: ["database", "database management system"]  
reading_time: 2 minutes  

---

# How to rename and drop a Database form SQL Server using command and Management Studio?

How to [rename](https://www.mindstick.com/interview/23303/how-to-rename-extention-of-mdf-file) and [drop](https://yourviews.mindstick.com/view/84030/how-to-investigate-a-sudden-drop-in-organic-traffic) a [Database](https://www.mindstick.com/articles/100/windows-service-to-update-record-from-one-database-to-another-after-certain-interval-of-time) from SQL [Server using command](https://answers.mindstick.com/qa/93949/how-to-drop-table-in-sql-server-using-command) and [Management Studio](https://www.mindstick.com/forum/159668/what-is-the-difference-between-sql-server-and-sql-management-studio)?

## Answers

### Answer by Ashutosh Kumar Verma

**Rename Database in [SQL Server](https://www.mindstick.com/articles/12343/sql-server-2017-ctp-2-0-now-available)-**

There are two ways to change the name of a Database in SQL Server.

**1- By using SQL sp_renamedb [Command](https://www.mindstick.com/blog/178/synchronous-and-asynchronous-command-execution-in-c-sharp-dot-net)-**

Syntax- **EXEC sp_renamedb '*oldDbName' , 'newDbName'* ;**

**Example-** The following SQL statement is used to change the existing database name 'Employees' to 'EmployeeDetails'

**EXEC sp_renamedb 'Employees' , 'EmployeeDetails';**

![How to rename and drop a Database form SQL Server using command and Management Studio?](https://answers.mindstick.com/questionanswer/c5e6a0de-c839-42ae-aef1-2c6f1fddb3fe/images/16d8bdd4-95b7-4187-98b4-60772da0ba24.png)

## 2- By using SQL ALTER Command-

**syntax-** **ALTER DATABASE oldDbName MODIFY NAME = newDbName ;**

**Example-** The following SQL statement is used change the existing Database name 'EmployeeDetails' to 'Employees'

**alter database EmployeeDetails modify name = Employees;** \
![How to rename and drop a Database form SQL Server using command and Management Studio?](http://answers.mindstick.com/QuestionAnswer/c5e6a0de-c839-42ae-aef1-2c6f1fddb3fe/images/27558972-b33b-455d-8c72-cd0c20d69c59.png)

\

**Delete Database in SQL Server-**

**Drop or Delete the Database using SQL Command -**

**Syntax-** DROP DATABASE *databaseName*;

**Example-** The following SQL statement is used to delete the database.

drop database DemoDB;

**Delete Database by using SQL Server [Management](https://www.mindstick.com/articles/23350/how-to-choose-a-project-management-platform-for-your-business) [Studio](https://answers.mindstick.com/qa/116181/google-launches-workspace-studio-to-create-automated-gemini-powered-agents)-**

To delete the Database from you SQL Server Management Studio. follow the below steps

Go To Object Explorer ---> Select Database you want to Delete ---> Right click on that Database name -----> Select 'Delete' option from Option Menu.

![How to rename and drop a Database form SQL Server using command and Management Studio?](https://answers.mindstick.com/questionanswer/c5e6a0de-c839-42ae-aef1-2c6f1fddb3fe/images/40e5eb98-0f15-479c-8be9-3c30dc850fd7.png) **\**

After click on Delete option a window open on your screen as like below. In which you click on OK

![How to rename and drop a Database form SQL Server using command and Management Studio?](https://answers.mindstick.com/questionanswer/c5e6a0de-c839-42ae-aef1-2c6f1fddb3fe/images/cec8276b-67ad-4a44-b95a-8f59bf8fd40a.png)\

\
\


---

Original Source: https://answers.mindstick.com/qa/93946/how-to-rename-and-drop-a-database-form-sql-server-using-command-and-management-studio

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
