次の方法で共有


ApplyToTargetServer Method

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

The ApplyToTargetServer method adds an execution target to the list of targets maintained for the referenced Microsoft SQL Server Agent job.

構文

object
.ApplyToTargetServer(
str
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • str
    String that specifies, by name, an instance of Microsoft SQL Server.

Prototype (C/C++)

HRESULT ApplyToTargetServer(SQLDMO_LPCSTR NewValue);

解説

Before a SQL Server Agent job can execute, the job must have at least one step and an execution target.

When using SQL Distributed Management Objects (SQL-DMO) to create, schedule, and run SQL Server Agent jobs, use either the ApplyToTargetServer or ApplyToTargetServerGroup method to add an execution target. When a job will run on the server running SQL Server Agent, use the ApplyToTargetServer method to target the job, which specifies the server using the string (local).

Applies to:

Job Object