| title | sp_help_targetservergroup (Transact-SQL) | ||
|---|---|---|---|
| description | sp_help_targetservergroup lists all target servers in the specified 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]
Lists all target servers in the specified group. If no group is specified, [!INCLUDE ssNoVersion] returns information about all target server groups.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_help_targetservergroup [ [ @name = ] N'name' ]
[ ; ]
The name of the target server group for which to return information. @name is sysname, with a default of NULL.
0 (success) or 1 (failure).
| Column name | Data type | Description |
|---|---|---|
servergroup_id |
int | Identification number of the server group |
name |
sysname | Name of the server group |
Permissions to execute this procedure default to the sysadmin fixed server role.
This example lists information for all target server groups.
USE msdb;
GO
EXECUTE dbo.sp_help_targetservergroup;
GOThis example lists information for the Servers Maintaining Customer Information target server group.
USE msdb;
GO
EXECUTE dbo.sp_help_targetservergroup N'Servers Maintaining Customer Information';
GO