次の方法で共有


RemoveJobByID Method

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

The RemoveJobByID method drops the SQL Server Agent job identified and removes the referencing Job object from the Jobs collection.

構文

object.RemoveJobByID(JobID)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • JobID
    String representation of the system-generated, globally unique identifier for a job.

Prototype (C/C++)

HRESULT RemoveJobByID(
SQLDMO_LPCSTR NewVal);

説明

For SQL Server Agent, a job identifier is a 32-byte string representing a hexadecimal number.

The RemoveJobByID method completely removes a job. When a multiserver administration job is targeted on the master server, the master server posts job-delete instructions to each execution target server. The indicated job is deleted at the master server immediately. Each target server deletes its local copy of the job when it next successfully polls the master server and retrieves the delete instruction.

注意注意

Removing a SQL Server Agent job by using the RemoveJobByID method requires appropriate permission. The Microsoft SQL Server login used for SQLServer object connection must be the owner of the job indicated by the JobID argument or a member of a role with greater privilege.

Applies To: