Partager via


TargetServer Object

Cette fonctionnalité sera supprimée dans une prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement, et prévoyez de modifier les applications qui utilisent actuellement cette fonctionnalité.

The TargetServer object represents an instance of Microsoft SQL Server on which a SQL Server Agent job is to run.

Modèle d'objet SQL-DMO qui affiche l'objet en cours

Properties

EnlistDate Property

PollingInterval Property

LastPollDate Property

ServerID Property

LocalTime Property

ServerName Property

Location Property (TargetServer)

Status Property (TargetServer)

PendingInstructions Property

TimeZoneAdjustment Property

Methods

Refresh Method

Notes

A SQL Server Agent job has an execution target. The SQL Server Agent can direct job execution from one instance of SQL Server to another within the same organization. Servers can enlist in the domain specified by a master SQL Server Agent. When a server enlists in a domain, it becomes a target server for job execution managed by the master SQL Server Agent.

Any instance on which SQL Server Agent is running provides the local instance as a valid target for job execution.

Target servers are defined only on a master SQL Server Agent, and the SQL Distributed Management Objects (SQL-DMO) TargetServers collection and each TargetServer object are populated only when SQL-DMO applications connect to an instance of SQL Server identified as the master in a multi-server administration group.

With the TargetServer object, you can:

  • Report the properties of a server that is an existing target in a multi-server administration group.
  • Set the location string for a server that is an existing target in a multi-server administration group.