Udostępnij za pośrednictwem


sp_remove_job_from_targets (Transact-SQL)

Usuwa określone zadanie z serwerów danego docelowego lub grupy serwer miejsce docelowe.

Topic link iconKonwencje składni języka Transact-SQL

sp_remove_job_from_targets [ @job_id = ] job_id 
     | [ @job_name = ] 'job_name' 
     [ , [ @target_server_groups = ] 'target_server_groups' ] 
     [ , [ @target_servers = ] 'target_servers' ]

Argumenty

  • [ @job_id =] job_id
    Numer identyfikacyjny zadania zadanie, z którego chcesz usunąć serwery określone miejsce docelowe lub grupy serwer docelowy.Either job_id or job_name must be specified, but both cannot be specified.job_id is uniqueidentifier, with a default of NULL.

  • [ @job_name =] 'job_name'
    Nazwa zadanie, z którego chcesz usunąć serwery określone miejsce docelowe lub grupy serwer docelowy.Either job_id or job_name must be specified, but both cannot be specified.job_name is sysname, with a default of NULL.

  • [ @target_server_groups =] 'target_server_groups'
    A comma-separated list of target server groups to be removed from the specified job.target_server_groups is nvarchar(1024), with a default of NULL.

  • [ @target_servers =] 'target_servers'
    A comma-separated list of target servers to be removed from the specified job.target_servers is nvarchar(1024), with a default of NULL.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Uprawnienia

Uprawnienia do wykonać to ustawienie domyślne procedury, aby członkowie sysadmin stała rola serwera.

Przykłady

W następującym przykładzie usunięto wcześniej utworzony Weekly Sales Backups zadanie z Servers Processing Customer Orders Grupa serwer miejsce docelowe, a z SEATTLE1 i SEATTLE2 serwery.

USE msdb ;
GO

EXEC dbo.sp_remove_job_from_targets
    @job_name = N'Weekly Sales Backups',
    @target_server_groups = N'Servers Processing Customer Orders', 
    @target_servers = N'SEATTLE2,SEATTLE1' ;
GO