1. Open the Microsoft SQL Server Management Studio Console root directory, SQL Server Agent, jobs.
2. Right button "new job".
3, select the "General" page on the left, enter the job "name" on the right, select "owner", "category" Select "Database Maintenance", "description" Custom.
4, select the "Steps" page on the left, click on the "New" button on the right, enter "step name", select "category" as "Transact-SQL script (T-SQL)", select the database you want to create the job, in "command" enter the following statement (incremental, differential and full backup three select one.) Remember to replace your backup save path and database name, I'm here for the ' d:/bak/' folder; The database is Yadongwuliu):
Incremental backup :
Backup DATABASE [Yadongwuliu] to disk = ' D:/bak/yadongwuliu.bak ';
Differential backup :
DECLARE @strPath NVARCHAR Set @strPath = ' d:/bak/' + ' yadongwuliu ' + '. Bak ' BACKUP DATABASE [Yadongwuliu] to DISK = @str Path with differential, Nounload, Noskip, Stats=10,noformat
Full backup :
DECLARE @strPath NVARCHAR Set @strPath = Convert (NVARCHAR), GETDATE (), Set @strPath = REPLACE (@strPath, ': ', '. ') Set @strPath = ' d:/bak/' + ' databasename ' [email protected] + '. Bak ' BACKUP DATABASE [Yadongwuliu] to DISK = @strPath with Noinit, Nounload, noskip, STATS = 10,noformat
5. Select the "Plan" page on the left, click on the "New" button on the right, enter "name", select "Scheduling type" and so on, which is configured according to your business needs.
SQLSERVER2005 automatically backing up the database with jobs