Export (0) Print
Expand All

Rename a Database

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

This topic describes how to rename a user-defined database in SQL Server 2016 by using SQL Server Management Studio or Transact-SQL. The name of the database can include any characters that follow the rules for identifiers.

In This Topic

Limitations and Restrictions

  • System databases cannot be renamed.



Requires ALTER permission on the database.

Arrow icon used with Back to Top link [Top]

To rename a database

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

  2. Make sure that no one is using the database, and then set the database to single-user mode.

  3. Expand Databases, right-click the database to rename, and then click Rename.

  4. Enter the new database name, and then click OK.

Arrow icon used with Back to Top link [Top]

To rename a database

  1. Connect to the Database Engine.

  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.

USE master;
ALTER DATABASE AdventureWorks2012
Modify Name = Northwind ;

Back up the master database after you rename any database.

Arrow icon used with Back to Top link [Top]

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft