Created
December 28, 2018 02:33
-
-
Save ducfilan/a2f93b3cdfdcad9a49f07d24812d1bf2 to your computer and use it in GitHub Desktop.
Rename SQL Server Database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER DATABASE [DB_NAME] | |
SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
GO | |
sp_rename 'DB_NAME', 'DB_NAME_NEW' ,'DATABASE'; | |
GO | |
ALTER DATABASE [DB_NAME_NEW] | |
SET MULTI_USER | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment