How to schedule a database backup operation by using SQL Server Management Studio
This article describes how to schedule a database backup operation by using SQL Server Management Studio (SSMS) for SQL Editions that support SQL Server Agent. To schedule backups for SQL Express editions, see Schedule and automate backups of SQL Server databases in SQL Server Express.
Use maintenance plans to back up databases
You can use Maintenance Plans to back up databases and transaction log files, perform differential backups, and define retention periods for your backups. For more information, see:
- Create a Maintenance Plan
- Create a Maintenance Plan (Maintenance Plan Design Surface)
- Use the Maintenance Plan Wizard
Use the Script Action to Job option to back up databases
To schedule a database backup using the Script Action to Job option in SSMS, follow these steps:
Start SQL Server Management Studio and select Connect > Database Engine.
In the Connect to Server dialog box, select the appropriate values in the Server type list, in the Server name list, and in the Authentication list.
In Object Explorer, expand Databases.
Right-click the database you want to back up, select Tasks, and then select Back Up.
In the Back Up Database - <DatabaseName> dialog box, make sure that Backup type is set to Full and Backup component is set to Database.
Under Destination, select Disk for the Back up to option and then select Add. For other options on this page, see Backup Database.
In the Select Backup Destination dialog box, enter a path and a file name in the Destinations on disk box, and then select OK.
In the Script list, select Script Action to Job.
If you don't see the Script Action to Job option, you may be running an express edition of SQL Server. You can check your edition by running the query
select@@version. For more information, see Determine which version and edition of SQL Server Database Engine is running.
In the New Job dialog box, select Steps under Select a page, and then select Edit if you want to change the job parameters.
In the Job Step Properties - 1 dialog box, you can see the backup command.
Microsoft is currently investigating an error message that can occur in SSMS at this step. If you get an exception at this step, repeat the procedure without this step and make any changes by editing the corresponding job under the Jobs menu under SQL Server Agent in Object Explorer.
Under Select a page, select Schedules, and then select New.
In the New Job Schedule dialog box, enter the job name in the Name box, specify the job schedule, and then select OK.
If you want to configure alerts or notifications, you can select Alerts or Notifications under Select a page.
Select OK two times.
You receive the following message:
The backup of database '<DatabaseName>' completed successfully.
To verify the backup job, expand SQL Server Agent, and then expand Jobs. When you do this step, the SQL Server Agent service must be running.
You can use a similar procedure to schedule transaction log and differential backups if you make the appropriate selection in Step 6 for Backup type. If you don't see the Transaction Log option in Backup type, check the recovery model of the database. You can't take transaction log backups if you are using the Simple Recovery model for your database.