Rename Database Using T-SQL in SQL Server 2008
In this article I describe how to change database name using SQL query.
In this article I describe how to rename database using T-SQL statement. There are various approaches to change SQL Server database name. Sometimes condition arises when you need to rename your database like refreshing the development server with current data or while restoring database and at that time you just give a temporary name but after that you need to rename it on your system.
ALTER DATABASE 'Old_Database_Name' MODIFY NAME= 'New_Database_Name'
Change database name using T-SQL statement
Open SQL Server Management Studio and connect to database engine.
Open New Query window.
Type following code and execute it.
/* create databse */
create database EmployeeDetails
/* change database name*/
alter database EmployeeDetails
modify name= EmployeePersonalDetails