Freigeben über


RemoveFromTargetServerGroup Method

Diese Funktion wird in zukünftigen Versionen von Microsoft SQL Server nicht mehr bereitgestellt. Verwenden Sie diese Funktion beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.

The RemoveFromTargetServerGroup method drops one or more execution targets for a SQL Server Agent job.

Syntax

object.RemoveFromTargetServerGroup(Val)

Parts

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

  • Val
    String that specifies a single target server group by name.

Prototype (C/C++)

HRESULT RemoveFromTargetServerGroup(
SQLDMO_LPCSTR NewVal);

Hinweise

Before a SQL Server Agent job can execute, the job must have at least one step and an execution target. When SQL Server Agent acts as a master server for multiserver administration servers, known execution targets servers can be grouped for easier targeting of multiple servers at one time.

When using SQL-DMO to create, schedule, and run SQL Server Agent jobs, use either the ApplyToTargetServer or ApplyToTargetServerGroup method to add an execution target. When one or more target servers have been targeted by using the ApplyToTargetServerGroup method, use the RemoveFromTargetServerGroupmethod to remove the group execution target.

For more information about configuring target server groups by using SQL Distributed Management Objects (SQL-DMO), see TargetServerGroup Object.

HinweisHinweis

When a group execution target is removed for a multiserver administration job, the master server posts job-delete instructions to all TSXs named in the group. The job is removed from grouped target servers, but remains defined at the target server. To completely remove a job from all servers participating in multiserver administration, use a job removing method such as the Remove method of the Job object or the RemoveJobByID method of the JobServer object.

Applies To: