Event Scheduling

Event scheduling enables you to schedule an event to occur based on a recurrence pattern. Event scheduling utilizes the Job Scheduler in SQL Server and the existing stored procedure sproc_Notification_Timer_ScheduledEvent.

The stored procedure takes the following arguments:

Entity: Schedule

Event: Schedule Occurrence Event

sproc_Notification_Timer_ScheduledEvent @key = ‘Birthdays’ (example)

The stored procedure creates the job that can be scheduled in SQL Server Management Studio.

Create and Attach a Schedule to a Job in SQL Management Studio

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

  2. Expand SQL Server Agent, expand Jobs, right-click the job you want to schedule, and click Properties.

  3. Select the Schedules page, and then click New.

  4. In the Name box, type a name for the new schedule.

  5. Clear the Enabled check box if you do not want the schedule to take effect immediately following its creation.

  6. For Schedule Type, click Recurring. Complete the Frequency, Daily Frequency, and Duration groups in the New Job Schedule window.

    event shceduler

Attach a Schedule to a Job

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

  2. Expand SQL Server Agent, expand Jobs, right-click the job that you want to schedule, that is, the job created by the stored procedure, and click Properties.

  3. Select the Schedules page, and then click Pick.

  4. Select the schedule you want to attach and click OK.

  5. In the Job Properties dialog box, double-click the attached schedule.

  6. Verify that Start date is set correctly. If it is not, set the date when you want for the schedule to start, and then click OK.

  7. In the Job Properties dialog box, click OK.