sp_add_targetsvrgrp_member (Transact-SQL)

Applies to: SQL Server

Adds the specified target server to the specified target server group.

Transact-SQL syntax conventions

Syntax

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

Arguments

[ @group_name = ] 'group_name'

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

[ @server_name = ] N'server_name'

The name of the server that should be added to the specified group. @server_name is nvarchar(30), with no default.

Return code values

0 (success) or 1 (failure).

Result set

None.

Remarks

A target server can be a member of more than one target server group.

Permissions

You can grant EXECUTE permissions on this procedure, but these permissions might be overridden during a SQL Server upgrade.

Examples

The following example adds the group Servers Maintaining Customer Information and adds the LONDON1 server to that group.

USE msdb;
GO

EXEC dbo.sp_add_targetsvrgrp_member
    @group_name = N'Servers Maintaining Customer Information',
    @server_name = N'LONDON1';
GO