방법

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

참고 자료

[https://docs.microsoft.com/ko-kr/sql/relational-databases/databases/rename-a-database?view=sql-server-2017]


to Top