Skip to content

Latest commit

 

History

History
86 lines (60 loc) · 2.44 KB

sp-delete-jobserver-transact-sql.md

File metadata and controls

86 lines (60 loc) · 2.44 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
sp_delete_jobserver (Transact-SQL)
sp_delete_jobserver removes the specified target server.
markingmyname
maghan
randolphwest
01/23/2024
sql
system-objects
reference
sp_delete_jobserver
sp_delete_jobserver_TSQL
sp_delete_jobserver
TSQL
>=sql-server-2016 || >=sql-server-linux-2017

sp_delete_jobserver (Transact-SQL)

[!INCLUDE SQL Server]

Removes the specified target server.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_delete_jobserver
    [ [ @job_id = ] 'job_id' ]
    [ , [ @job_name = ] N'job_name' ]
    , [ @server_name = ] N'server_name'
[ ; ]

Arguments

[ @job_id = ] 'job_id'

The identification number of the job from which the specified target server will be removed. @job_id is uniqueidentifier, with a default of NULL.

Either @job_id or @job_name must be specified, but both can't be specified.

[ @job_name = ] N'job_name'

The name of the job from which the specified target server will be removed. @job_name is sysname, with a default of NULL.

Either @job_id or @job_name must be specified, but both can't be specified.

[ @server_name = ] N'server_name'

The name of the target server to remove from the specified job. @server_name is sysname, with no default. @server_name can be (LOCAL) or the name of a remote target server.

Return code values

0 (success) or 1 (failure).

Result set

None.

Permissions

To run this stored procedure, users must be members of the sysadmin fixed server role.

Examples

The following example removes the server SEATTLE2 from processing the Weekly Sales Backups job. This example assumes that the Weekly Sales Backups job was created previously.

USE msdb;
GO

EXEC sp_delete_jobserver
    @job_name = N'Weekly Sales Backups',
    @server_name = N'SEATTLE2';
GO

Related content