次の方法で共有


JobSchedule Object

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The JobSchedule object exposes the attributes of a single SQL Server Agent executable job schedule.

現在のオブジェクトを表す SQL-DMO オブジェクト モデル

Properties

DateCreated Property

Name Property

Enabled Property

ScheduleID Property

Methods

BeginAlter Method

Refresh Method

CancelAlter Method

Remove Method (Objects)

DoAlter Method

 

解説

SQL Server Agent jobs can be scheduled for execution by using SQL Server Agent. Scheduling jobs automates job execution when SQL Server Agent is enabled but jobs are not required to be scheduled. They can be executed on demand by a user with sufficient permissions. Jobs can have more than one active schedule, and SQL Server Agent evaluates all schedules to determine when to run the job.

With the JobSchedule object, you can:

  • Create a schedule for a SQL Server Agent job.
  • Remove a schedule from an existing SQL Server Agent job.
  • Manage job schedules either by enabling a schedule or adjusting run times or frequencies.

The Name property of a JobSchedule object can contain up to 100 characters. The value of the Name property must be unique within a job.

To schedule a SQL Server Agent job for execution by SQL Server Agent

  1. Create a JobSchedule object.

  2. Set the Name property.

  3. Get the Schedule object from the specified JobSchedule object.

  4. Set the properties of the Schedule object.

  5. Add the JobSchedule object to the JobSchedules collection of a Job object that references an existing SQL Server Agent job.