---
title: "What command do we use to rename a db?"  
description: "What command do we use to rename a db?"  
author: "Amit Singh"  
published: 2011-05-03  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/818/what-command-do-we-use-to-rename-a-db  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# What command do we use to rename a db?

sp_renamedb ‘oldname’ , ‘newname’

## Answers

### Answer by Amit Singh

sp_renamedb ‘oldname’ , ‘newname’


---

Original Source: https://www.mindstick.com/interview/818/what-command-do-we-use-to-rename-a-db

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
