| title | sp_help_targetserver (Transact-SQL) | ||
|---|---|---|---|
| description | sp_help_targetserver lists all target servers. | ||
| 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.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_help_targetserver [ [ @server_name = ] N'server_name' ]
[ ; ]
The name of the server for which to return information. @server_name is sysname, with a default of NULL.
0 (success) or 1 (failure).
If @server_name isn't specified, sp_help_targetserver returns this result set.
| Column name | Data type | Description |
|---|---|---|
server_id |
int | Server identification number. |
server_name |
nvarchar(30) | Server name. |
location |
nvarchar(200) | Location of the specified server. |
time_zone_adjustment |
int | Time zone adjustment, in hours, from Greenwich mean time (GMT). |
enlist_date |
datetime | Date of the specified server's enlistment. |
last_poll_date |
datetime | Date the server was last polled for jobs. |
status |
int | Status of the specified server. |
unread_instructions |
int | Specifies whether the server has unread instructions. If all rows are downloaded, this column is 0. |
local_time |
datetime | Local date and time on the target server, which is based on the local time on the target server as of the last poll of the master server. |
enlisted_by_nt_user |
nvarchar(100) | Microsoft Windows user that enlisted the target server. |
poll_interval |
int | Frequency in seconds with which the target server polls the master SQLServerAgent service in order to download jobs and upload job status. |
To execute this stored procedure, a user must be a member of the sysadmin fixed server role.
The following example lists information for all registered target servers.
USE msdb;
GO
EXECUTE dbo.sp_help_targetserver;
GOThe following example lists information for the target server SEATTLE2.
USE msdb;
GO
EXECUTE dbo.sp_help_targetserver N'SEATTLE2';
GO