Renaming Database Names in SQL Server

Q

How to rename databases in SQL Server?

✍: FYIcenter.com

A

If don't like the name of a database, you can change it by using the "ALTER DATABASE" statement with the following syntax:

ALTER DATABASE database_name 
   MODIFY NAME = new_database_name

The tutorial example below shows you how change the database name from "FyiCenterData" to "FyiCenterComData":

ALTER DATABASE FyiCenterData 
   MODIFY NAME = FyiCenterComData
GO
The database name 'FyiCenterComData' has been set.

 

Managing Databases and Physical Files in SQL Server

⇒⇒SQL Server Database Tutorials

2016-11-24, 585👍, 0💬