Rename a Database
This topic describes how to rename a user-defined database in SQL Server 2012 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
-
Before you begin:
-
To rename a database, using:
-
Follow Up: After renaming a database
To rename a database
-
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
-
Make sure that no one is using the database, and then set the database to single-user mode.
-
Expand Databases, right-click the database to rename, and then click Rename.
-
Enter the new database name, and then click OK.
To rename a database
-
Connect to the Database Engine.
-
From the Standard bar, click New Query.
-
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; GO ALTER DATABASE AdventureWorks2012 Modify Name = Northwind ; GO
