SQL Server – Restore Database Maintenance Plan Task

maintenance-plansrestoresql server

I need to schedule a task that restores a database once a week from a backup. I have setup maintenance plans for backing up databases (Management > Maintenance Plans) but cannot find out how to make a restore task – does this need to be an Execute T-SQL Statement Task, or is there a Toolbox item for it?

Best Answer

There is no 'Restore DB Task' in the maintenance plan. You will have to use the Execute T-SQL Statement Task. In that task, add a restore script in your T-SQL statement. Simple example:

RESTORE DATABASE YourDBName FROM DISK = 'D:\DBbackups\YourDB.BAK'
WITH REPLACE
GO

Then create a schedule for weekly execution. Hope this is what the business requires, as you are overwriting a DB.