次の方法で共有


JobSteps Collection

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

The JobSteps collection contains JobStep objects defining the administrative tasks automated by a SQL Server Agent job.

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

Properties

Count Property

 

Methods

Add Method

Refresh Method

Item Method

Remove Method (Collections)

ItemByID Method

 

解説

When using SQL Distributed Management Objects (SQL-DMO) to create and manage a SQL Server Agent job, an administrative task, called a step, is referenced by a single JobStep object. Adding a JobStep object to the JobSteps collection adds the task to the referenced job, allowing automated task execution.

With the JobSteps collection, you can:

  • Add a step (administrative task) to a SQL Server Agent job.
  • Remove a step from a SQL Server Agent job.

For more information about configuring job tasks by adding a JobStep object to or removing it from the JobSteps collection, see the Job Object and JobStep Object sections.

When using the Item or Remove method, the JobSteps collection supports member identification using either name or ordinal reference syntax. For example:

Set oJobStep = oJob.JobSteps("DBCC_CHECKDB_Northwind")

Or

Set oJobStep = oJob.JobSteps(3)
ms141948.note(ja-jp,SQL.90).gifメモ :
Defining SQL Server Agent job steps using the JobSteps collection requires appropriate privilege. The Microsoft® SQL Server™ login used for SQLServer object connection must be a member of the fixed role public in the system database msdb. With public membership, the connection may add steps to, and remove steps from, jobs belonging to the connected login. Members of the db_owner role in msdb, or members of a role with greater privilege, can modify any SQL Server Agent job.