Translate

How to scheduled a job in SQL?

If we want to schedule any stored procedure to execute automatically either once or repeatedly on specific time then we need to scheduled job for that stored procedure.

Steps to scheduled Job given below:

1. Connect to the data base server and open SQL Management Studio.

2. Go to SQL Server object explorer => SQL Server Agent, there is a Jobs folder. We need to right click on jobs folder and choose New Job option.

3. A new window to create new Job will be opened. Provide appropriate name of the Job.

4. Now click on "Steps" in the left menu of the new Job window and click on New button. A SQL job can have one or more steps. Provide step name, select database name and put the stored procedure name in command text box and click on “Ok”.

5. Now click on the "Schedules" in the left menu of the new Job window and click on New button. A SQL job can have one or more schedules. Provide schedule name and provide frequency and click on “Ok”. It is basically the time on which the Job will run automatically. We have options of recurring the schedules also.

6. We can also also create alert and notifications for the Job. We can set email id to send email after execution of the Job as well.

No comments:

Post a Comment