Last active
December 2, 2020 17:15
-
-
Save aspen-roller/0868c37758cb6a605eb8a54d3eb4a86c to your computer and use it in GitHub Desktop.
SQL Server DB Restore (Bob Edition) #mssql
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
USE [master] | |
ALTER DATABASE [Admin] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
RESTORE DATABASE [Admin] FROM DISK = N'H:\PREPROD\Admin.bak' WITH FILE = 1 | |
, MOVE N'Admin' TO N'D:\Data\QA1\Admin.mdf' | |
, MOVE N'Admin_log' TO N'H:\TransactionLogs\QA1\Admin.ldf', NOUNLOAD, REPLACE, STATS = 5 | |
ALTER DATABASE [Admin] SET MULTI_USER | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment