Last active
March 6, 2018 13:28
-
-
Save a-sitnikov/70350d90fabd353006bbacc3921bd7a7 to your computer and use it in GitHub Desktop.
Restore MSSQL base
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; | |
GO | |
ALTER DATABASE [uh-sitnikov] | |
SET SINGLE_USER | |
WITH ROLLBACK IMMEDIATE; | |
GO | |
RESTORE DATABASE [uh-sitnikov] | |
FROM DISK = N'D:\MSSQL\Backup\uh2.bak' | |
WITH FILE = 1, | |
MOVE N'uh_asc' TO N'D:\MSSQL\Data\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\uh-sitnikov.mdf', | |
MOVE N'uh_asc_log' TO N'D:\MSSQL\Data\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\uh-sitnikov_log.LDF', | |
NOUNLOAD, REPLACE, STATS = 10 | |
GO | |
ALTER DATABASE [uh-sitnikov] | |
SET MULTI_USER | |
WITH ROLLBACK IMMEDIATE; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment