The scheduling task of using SQL can handle some special environment data, in addition to using the Windows system scheduled tasks to handle the time, but to cooperate with the program, some things can directly use the SQL itself to schedule tasks, more convenient, so this article illustrates the SQL2005 planning task creation use.
The specific steps for creating a scheduled task in SQL server2005 are as follows:
You must first confirm that the SQL Server Agent service is started, so that the service is stopped, you cannot create it.
Then, log on to the database server as the database administrator, and right-click on the maintenance plan as shown below:
Select New Maintenance plan, enter plan name
Then, select the scheduled task execution time
Click to confirm, you can create task specific task content, we can be in the left-hand side of the task options, select the type of task to be performed, drag and drop over, where I chose to perform T-SQL task, the following diagram
When you are done, right-click on the task and select Edit, as shown in the pop-up window below.
You can type the T-SQL statement that we want to execute, of course, before that, to set up the connection to the database server, click New, pop-up form for the appropriate settings on it, this should be very simple, the following diagram:
This way, the scheduled task is created, and click Confirm Save.
This approach requires administrator privileges on the server, which can have certain limitations on application development.