SQL-DMO

TargetServerGroups Collection

The TargetServerGroups collection contains TargetServerGroup objects that classify lists of multiserver administration target servers (TSXs) referenced by the TargetServers collection.

Methods
Add Method Refresh Method
Item Method Remove Method (Collections)
ItemByID Method  

Remarks

A SQL Server Agent job has an execution target. With Microsoft® SQL Server™ version 7.0, the SQL Server Agent of one server can direct job execution on other instances of SQL Server within an organization. A server directing job execution is a master server (MSX). Each MSX server in an organization can maintain and organize lists of TSXs, called target server groups.

A SQL Server Agent job execution target can be:

With the TargetServerGroups collection, you can:

To create a target server group

  1. Create a TargetServerGroup object.

  2. Configure the TargetServerGroup object by setting the Name property.

  3. Add the TargetServerGroup object to the TargetServerGroups collection of a JobServer object referencing an MSX server.

To remove a target server group



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

Set oTargetServerGroup = oJobServer.TargetServerGroups("London_TSX")

Or:

Set oTargetServerGroup = oJobServer.TargetServerGroups(2)