MS SQL RENAME BATABASE
//*Rename MSSQL Database name*//
alter database mydb modify name = OLD;
//* Using SP_RENAME*//
SP_RenameDb N'OLD_DB', 'NEW_DB';
Green Team
//*Rename MSSQL Database name*//
alter database mydb modify name = OLD;
//* Using SP_RENAME*//
SP_RenameDb N'OLD_DB', 'NEW_DB';
USE master;
GO
ALTER DATABASE MyTestDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE MyTestDatabase MODIFY NAME = MyTestDatabaseCopy ;
GO
ALTER DATABASE MyTestDatabaseCopy SET MULTI_USER
GO
RENAME DATABASE MODIFY NAME=emptestdb;