TargetServerGroups Collection
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.
The TargetServerGroups collection contains TargetServerGroup objects that classify lists of multiserver administration target servers referenced by the TargetServers collection.
Methods
|
주의
A SQL Server Agent job has an execution target. With Microsoft SQL Server 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. Each master server server in an organization can maintain and organize lists of target servers, called target server groups.
A SQL Server Agent job execution target can be:
- The instance of SQL Server on which a SQL Server Agent is executing.
- One or more target server servers, specified using either the names of the target server servers and/or the names of target server groups.
With the TargetServerGroups collection, you can:
- Create a target server group on a SQL Server Agent acting as an master server server in an organization.
- Remove a target server group from an master server server.
To create a target server group
Create a TargetServerGroup object.
Configure the TargetServerGroup object by setting the Name property.
Add the TargetServerGroup object to the TargetServerGroups collection of a JobServer object referencing an master server server.
To remove a target server group
Use the Remove method of the TargetServerGroups object, as in:
oJobServer.TargetServerGroups.Remove("[Seattle_target server]")
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_target server")
Or:
Set oTargetServerGroup = oJobServer.TargetServerGroups(2)