Returns information about the server for a given job.
sp_help_jobserver [@job_id =] job_id |
[@job_name =] 'job_name'
[,[@show_last_run_details =] show_last_run_details]
Note Either job_id or job_name must be specified, but both cannot be specified.
0 (success) or 1 (failure)
Column name | Data type | Description |
---|---|---|
server_id | int | Identification number of the target server. |
server_name | nvarchar(30) | Computer name of the target server. |
enlist_date | datetime | Date the target server enlisted into the master server (MSX). |
last_poll_date | datetime | Date the target server last polled the MSX. |
If sp_help_jobserver is executed with show_last_run_details set to 1, the result set has these additional columns.
Column name | Data type | Description |
---|---|---|
last_run_date | int | Date the job last started execution on this target server |
last_run_time | int | Time the job last started execution on this server |
last_run_duration | int | Duration of the job the last time it ran on this target server (in seconds) |
last_outcome_message | nvarchar(1024) | Outcome of the job the last time it ran on this server: 0 = Failed 1 = Succeeded 3 = Canceled 5 = Unknown. |
Permissions to execute this procedure default to the sysadmin fixed server role or the db_owner fixed data base role, who can grant permissions to other users.
This example returns information, including last-run information, about the Archive Tables job.
USE msdb
EXEC sp_help_jobserver 'Archive Tables', 1
sp_add_jobserver | System Stored Procedures |
sp_delete_jobserver |