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?
SQL Server – Restore Database Maintenance Plan Task
maintenance-plansrestoresql server
Related Question
- SQL Server – Maintenance Plan Job Running at Unscheduled Times
- Sql-server – How to know that , Is it Maintenance Cleanup Task is working properly from maintenance Plan or not through T-SQL
- SQL Server Backup – Should Multiple Maintenance Plans Be Created for Over 200 Databases?
- SQL Server – Choosing Specific Database Name in T-SQL Statement Task
- SQL Server – Transaction Log Backup Maintenance Plan for Restored Databases
- Creating a Maintenance Plan for a SQL Azure Database
- SQL Server – Full Database Backup Without a Job
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:Then create a schedule for weekly execution. Hope this is what the business requires, as you are overwriting a DB.