This post was last edited by Kongcida on 2019-4-13 17:02
preface
In some scenarios, we need to use timed execution tasks. For example: regular statistics, regular backup of databases, regular sending of emails, regular cleaning of data, etc. Record the database job execution today.
environment
>SQL Server2008
tools
>Microsoft SQL Server Management Studio
Text
step1: Open the SQL Server management tool and connect to the local database.
step2: Right-click the job - > Create a new job. The New Job dialog box pops up.
step3: in the New Job dialog box. In the General tab, fill in the name, owner, category, and description of the job.
step4: In the Steps tab, click New. In the pop-up New Job Step dialog box, fill in the Step Name, Database, and Command -> OK.
As shown in the picture above, in the command here, I filled in the "exec proc_ExpenseSummary”。 Refers to the execution of a stored procedure called "proc_ExpenseSummary". You can also fill in the SQl statement you want to execute here. For example, "Update...............”。 In this step, the tasks to be performed are already created. In the next step, start to create the frequency and time of the planned execution of this task
step5: In the Plans tab, create New. In the pop-up New Job Plan dialog box, set the Name, Frequency, and Execution Time -> OK.
step6Finally, in the New Job dialog box -- > OK. That's it.
Epilogue
Database job planning is still very common. The next article will document Creating a Windows Task Scheduler.
|