Skip to content

Instantly share code, notes, and snippets.

@OliverRC
Created February 18, 2014 12:40
Show Gist options
  • Save OliverRC/9070186 to your computer and use it in GitHub Desktop.
Save OliverRC/9070186 to your computer and use it in GitHub Desktop.
restore-db.sql
USE master
GO
--Run to varify backup and view Logical and Physical Names
RESTORE FILELISTONLY
FROM disk = 'C:\<backfile>'
--Run once you are happy with everything
RESTORE DATABASE <databasename>
FROM disk = 'C:\<backfile>'
WITH RECOVERY,
MOVE 'LogicalName' TO 'C:\<logicalfielname>.mdf',
MOVE 'LogicalName_log' TO 'C:\<logicalfielname>.ldf'
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment