Export (0) Print
Expand All

ApplyToTargetServer Method

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

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

object.ApplyToTargetServer(str)

object

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

str

String that specifies, by name, an instance of Microsoft SQL Server.

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).

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft