--- title: "Rename a Database | Microsoft Docs" ms.custom: "" ms.date: "11/20/2017" ms.prod: "sql" ms.prod_service: "database-engine" ms.service: "" ms.component: "databases" ms.reviewer: "" ms.suite: "sql" ms.technology: - "database-engine" ms.tgt_pltfrm: "" ms.topic: "article" helpviewer_keywords: - "databases [SQL Server], renaming" - "renaming databases" ms.assetid: 44c69d35-abcb-4da3-9370-5e0bc9a28496 caps.latest.revision: 19 author: "stevestein" ms.author: "sstein" manager: "craigg" ms.workload: "Active" monikerRange: "= azuresqldb-current || >= sql-server-2016 || = sqlallproducts-allversions" --- # Rename a Database [!INCLUDE[appliesto-ss-asdb-xxxx-xxx-md](../../includes/appliesto-ss-asdb-xxxx-xxx-md.md)] This topic describes how to rename a user-defined database in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)]. The name of the database can include any characters that follow the rules for identifiers. **In This Topic** - **Before you begin:** [Limitations and Restrictions](#Restrictions) [Security](#Security) - **To rename a database, using:** [SQL Server Management Studio](#SSMSProcedure) [Transact-SQL](#TsqlProcedure) - **Follow Up:** [After renaming a database](#FollowUp) > [!NOTE] > To rename a database in Azure SQL Database, use the [ALTER DATABASE (Azure SQL Database)](../../t-sql/statements/alter-database-azure-sql-database.md) statement. To rename a database in Azure SQL Data Warehouse or Parallel Data Warehouse, use the [RENAME (Transact-SQL)](/t-sql/statements/rename-transact-sql) statement. ## Before You Begin ### Limitations and Restrictions - System databases cannot be renamed. ### Security #### Permissions Requires ALTER permission on the database. ## Using SQL Server Management Studio #### To rename a database 1. In **Object Explorer**, connect to an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)], and then expand that instance. 2. Make sure that no one is using the database, and then [set the database to single-user mode](../../relational-databases/databases/set-a-database-to-single-user-mode.md). 3. Expand **Databases**, right-click the database to rename, and then click **Rename**. 4. Enter the new database name, and then click **OK**. ## Using Transact-SQL #### To rename a database 1. Connect to the [!INCLUDE[ssDE](../../includes/ssde-md.md)]. 2. From the Standard bar, click **New Query**. 3. Copy and paste the following example into the query window and click **Execute**. This example changes the name of the `AdventureWorks2012` database to `Northwind`. ```sql USE master; GO ALTER DATABASE AdventureWorks2012 Modify Name = Northwind ; GO ``` ### ## Follow Up: After renaming a database Back up the **master** database after you rename any database. ## See Also [ALTER DATABASE (Transact-SQL)](../../t-sql/statements/alter-database-transact-sql.md) [Database Identifiers](../../relational-databases/databases/database-identifiers.md)