Created
September 10, 2015 23:12
-
-
Save evgenylavelin-xx/67f84c8bd117f8783357 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ----Make Database to single user Mode | |
| ALTER DATABASE YourDB | |
| SET SINGLE_USER WITH | |
| ROLLBACK IMMEDIATE | |
| ----Restore Database | |
| RESTORE DATABASE YourDB | |
| FROM DISK = 'D:\BackUpYourBaackUpFile.bak' | |
| WITH MOVE 'YourMDFLogicalName' TO 'D:\DataYourMDFFile.mdf', | |
| MOVE 'YourLDFLogicalName' TO 'D:\DataYourLDFFile.ldf' | |
| /*If there is no error in statement before database will be in multiuser | |
| mode. | |
| If error occurs please execute following command it will convert | |
| database in multi user.*/ | |
| ALTER DATABASE YourDB SET MULTI_USER | |
| GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment