Created
November 6, 2015 12:46
-
-
Save brandedoutcast/69823a6a1ff66db26b2a to your computer and use it in GitHub Desktop.
Rename a database by setting it into single user mode
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
USE master | |
ALTER DATABASE [DatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
ALTER DATABASE [DatabaseName] MODIFY NAME = [NewDatabaseName] | |
ALTER DATABASE [NewDatabaseName] SET MULTI_USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment