Schedule Jobs:
Jobs are scheduled objects which will execute a sequence of stored statements at a particular time or at regular intervals. Considering a practical scenario like, I need to take a backup of my database at regular intervals (Daily at 12AM). How can I achieve it?
This can be achieved through jobs in sql server. I will take a very simple scenario of inserting a record in a table. This insert should happen on weekly basis (One time) with no end date. Let's see the step by step procedure to ahieve it.
Below is the table (I need to insert into this table),

Got to steps tab, and click New to create the steps. A job can have any number of steps. We can arrange the step. So that, it will execute on the prescribed order.

On clicking the new button in the above window, we will get the steps window. You can provide the step name and command to be executed.
After providing the command, you can check the syntax by clicking the parse button.
Go to the scheduled tab and you can schedule your job. A job may have multiple schedules.
Now, I am creating the job which recurrent/weekly once /only on sunday /Occurs at 12AM /Start date is today / No end date.

Goto the next tab "Alert" -> You can customize the message for the job failure or else you can take the existing alerts.

That's it. Your job is ready to go. On clicking the Jobs, you can see your new job.
Considering, I need to execute the job now. Just right click the job and click start job.

To check the activity of the job in the servers. Right click job activity monitor and check it.

On clicking the new button in the above window, we will get the steps window. You can provide the step name and command to be executed.




Goto the next tab "Alert" -> You can customize the message for the job failure or else you can take the existing alerts.
Go to the Notification tab -> You can specify the notification details. How you want the notification through email or through page or net send or just write it in windows app event log.

That's it. Your job is ready to go. On clicking the Jobs, you can see your new job.


To check the activity of the job in the servers. Right click job activity monitor and check it.
select * from sysjobs -> List down all the jobs available in the server. It holds all the information like job name/description/owner/job failure details/versionnumber/job creation date/job modification date.
select * from dbo.sysjobschedules - >This table will show the scheduled job details. Job name/next run date.
select * from dbo.sysjobschedules - >This table will show the scheduled job details. Job name/next run date.