The specific steps are as follows:
First, open SQL Server Management Studio in the Start menu, expand the SQL Servers on the left side of the window;
Second, SQL Server Agent, right click to select "Start" (not started);
Third, select "Job-> new Job";
Enter the name of the job in "General";
Five, in the "step" in the new step, select T-SQL, the command entered the following statement (red part to change according to their actual situation, D:\bak\ to their own backup path, DatabaseName modified to the name of the database you want to back up)
Copy Code code as follows:
DECLARE @DBPATH NVARCHAR (200)
SET @DBPATH =convert (Varchar,getdate (), 120)
SET @DBPATH =replace (@DBPATH, '-', ')
SET @DBPATH =replace (@DBPATH, ', ')
SET @DBPATH =replace (@DBPATH, ': ', ')
SET @DBPATH = ' D:\DBBACKUP\ ' + @DBPATH + '. Bak '
BACKUP DATABASE [DATABASENAME] to DISK = @DBPATH with Noinit,nounload,noskip,stats=10,noformat
To add a plan in the plan, fill out the plan name, select the type of plan, set the frequency, time, etc. when the setup is complete, click OK.
Sqlserver2005 Automatic backup Diagram tutorial
First, open SQL Server Management Studio Enterprise Manager
Second, SQL Server Agent, right-click to select "Start"
Tips: Note that the SQL Server Agent here modifies the startup type to Automatic
Third, a new job
①. Right à new job
②. Fill in the name, owner information
③. Click the Step tab and click "New" to add a new step
④. Complete the basic information of the steps, such as: Name T-SQL (BACKUP statement)
Tips: The following statement to complete the backup database:
Declare @DataStr NVARCHAR (200)
Set @DataStr = Convert (NVARCHAR), GETDATE (), 120)
Set @DataStr = REPLACE (@DataStr, ': ', ' _ ')
Set @DataStr = REPLACE (@DataStr, ', ' _ ')
Set @DataStr = REPLACE (@DataStr, '-', ' _ ')
Set @DataStr = ' e:\databasebak\370501_#_#_ ' + @DataStr + '. Bak '
BACKUP DATABASE [370501] to DISK = @DataStr with Noinit, Nounload, noskip, STATS = ten, Noformat
T-SQL Feature Description:
The role of T-SQL here is to back up a backup file named: 370501_#_#_ 2010_08_05_15_23_01.bak, and place this file in the E:\DataBaseBak directory
⑤, click the Plan tab, click Add to add a program
⑥. Fill in the name and the execution frequency of the Plan in the dialog box that pops up
⑦. Click OK save current plan à click OK save current job, auto back up database complete