Run SQL Server Management Studio Express.
- In the tree view, expand Server Objects => New Backup Device.
- The Backup Device dialog opens
- For Device Name, type in a name for your new backup job.
- For Destination, select the path to store the backups. In most cases, it is best to use an location on another device.
- Press OK.
- Right click on the new backup device that you just created and select the option called “Backup Database”.
- Select the backup type (most often this is “Full”).
- Select the backup type (most often this is “Full”).
- On the left side, select Backup Options and set the following:
- Name: Create a name for the backup job.
- Description (optional).
- Press OK.
- SQL Server runs the backup job to test it. If successful, it confirms this with the following message:
- To verify the backup output yourself, check the destination folder to ensure that the backup file exists. The backup of the database is in the form of a .bak file.
The setup of the backup job is now complete. Repeat these steps for each database you wish to backup.
A batch file can be used to run the SQL Server backup job that you just created. Here’s an example (remember to save this file with a “BAT” file extension):
--- < Begin Code Batch Script > ---
sqlcmd -S MYSERVEROFFICESERVERS -E -Q
"BACKUP DATABASE MASTER TO T ESTBACKUP"
--- < End Code Batch Script > -----
..where “MYSERVER” is the name of the SQL Server physical machine.
..where “OFFICESERVERS” is the name of the SQL Server.
..where “TESTBACKUP” is the name of the backup job.
..where “MASTER” is the name of the database.
For this task to run automatically, it must be assigned to a scheduler program. Here are a few options:
- The built in Microsoft Windows Scheduler and assign the batch file created above to a scheduled event.
- FMS offers a program Total Visual Agent, which includes the ability to execute and run a specified batch command on the schedule that best suits your needs and maintain an audit log.