| title | sp_add_targetsvrgrp_member (Transact-SQL) | ||
|---|---|---|---|
| description | Adds the specified target server to the specified target server group. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Adds the specified target server to the specified target server group.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_add_targetsvrgrp_member
[ @group_name = ] 'group_name'
, [ @server_name = ] N'server_name'
[ ; ]
The name of the group. @group_name is sysname, with no default.
The name of the server that should be added to the specified group. @server_name is nvarchar(30), with no default.
0 (success) or 1 (failure).
None.
A target server can be a member of more than one target server group.
[!INCLUDE msdb-execute-permissions]
The following example adds the group Servers Maintaining Customer Information and adds the LONDON1 server to that group.
USE msdb;
GO
EXECUTE dbo.sp_add_targetsvrgrp_member
@group_name = N'Servers Maintaining Customer Information',
@server_name = N'LONDON1';
GO