sp_delete_targetsvrgrp_member (Transact-SQL)

Applies to: SQL Server

Removes a target server from a target server group.

Transact-SQL syntax conventions

Syntax

sp_delete_targetsvrgrp_member
    [ @group_name = ] N'group_name'
    , [ @server_name = ] N'server_name'
[ ; ]

Arguments

[ @group_name = ] N'group_name'

The name of the group. @group_name is sysname, with no default.

[ @server_name = ] N'server_name'

The name of the server to remove from the specified group. @server_name is sysname, with no default.

Return code values

0 (success) or 1 (failure).

Result set

None.

Permissions

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

Examples

The following example removes the server LONDON1 from the Servers Maintaining Customer Information group.

USE msdb;
GO

EXEC sp_delete_targetsvrgrp_member
    @group_name = N'Servers Maintaining Customer Information',
    @server_name = N'LONDON1';
GO