How To Restore A Database SQL Server



TODO:

Have you ever wanted to restore a database using SQL commands

 

SOLUTION:

restore database MyDB from disk = N'g:\MyDB.bak' 
	WITH MOVE 'MyDB_data' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10.X\MSSQL\DATA\MyDB.mdf',
	MOVE 'MyDB_log' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10.X\MSSQL\DATA\MyDB.ldf'

NOTES:

No notes apply to this topic.