Home
Manage Your Code
Snippet: SQL Restore (SQL)
Title: SQL Restore Language: SQL
Description: SQL Restore Views: 544
Author: David Speight Date Added: 10/17/2011
Copy Code  
RESTORE DATABASE [MydbName] FROM  DISK = N'D:\Restores\MydbName.bak' WITH  FILE = 1,  MOVE N'MydbName' TO N'D:\Database\MSSQL.1\MSSQL\Data\MydbName.mdf',  MOVE N'MydbName_log' TO N'D:\Database\MSSQL.1\MSSQL\Data\MydbName.ldf',  NOUNLOAD,  REPLACE,  STATS = 10
GO
Usage
SQL Database Restore
Notes
SQL Server 2005/2008