The main tasks to be accomplished are:
1. Periodic (periodic) backups of the database
2. Perform certain actions (work) at regular intervals
For example: The job that needs to be done is to test the database 1:00 every day, backup a copy of D:\fullbak, and name the backup database Test+yyymmdd (back up time). bak.
--Database automatic backup (SQL Server Agent-> job-> right key new job-> general inside write name and owner-> step inside code-> plan inside write frequency and execution time)
First step: In the SQL Server agent, select the job, right-click the new job, and fill in the job name. Description: Function Description of this job
Step Two: Click the step, create a new one, in the 3rd position shown in the following figure, you edit the code for the backup database:
DECLARE @filename VARCHAR (255)
DECLARE @date DATETIME
SELECT @date =getdate ()
SELECT @filename = ' F:\fullbak\test '
+cast (DATEPART (yyyy, @date) as varchar)
+cast (DATEPART (mm, @date) as varchar)
+cast (DATEPART (DD, @date) as varchar) + '. Bak '
BACKUP DATABASE [Test] to DISK = @filename with COMPRESSION
Step three: In the click Plan, new plan. Set the execution frequency in the plan
Conclusion: This database can be based on your own set up the cycle, automatic backup database. Once the database has been accidentally deleted, you can use the Backed-up database to restore it.
PS: I hope this agent work for everyone to help.