Returns information about the server for a given job.
Identification number of the target server.
Computer name of the target server.
Date the target server enlisted into the master server.
Date the target server last polled the master server.
If sp_help_jobserver is executed with show_last_run_details set to 1, the result set has these additional columns.
Date the job last started execution on this target server.
Time the job last started execution on this server.
Duration of the job the last time it ran on this target server (in seconds).
Describes the last outcome of the job.
Outcome of the job the last time it ran on this server:
0 = Failed
1 = Succeeded
3 = Canceled
5 = Unknown
By default, members of the sysadmin fixed server role can execute this stored procedure. Other users must be granted one of the following SQL Server Agent fixed database roles in the msdb database:
For details about the permissions of these roles, see SQL Server Agent Fixed Database Roles.
Members of SQLAgentUserRole can only view information for jobs that they own.
The following example returns information, including last-run information, about the NightlyBackups job.
USE msdb ; GO EXEC dbo.sp_help_jobserver @job_name = N'NightlyBackups', @show_last_run_details = 1 ; GO