Returns metadata about a specific SQL Server Agent job step log. sp_help_jobsteplog does not return the actual log.
Unique identifier of the job.
Name of the job.
Identifier for the step within the job. For example, if the step is the first step in the job, its step_id is 1.
Name of the step in the job.
Unique identifier of the step (system generated) in the job.
Date that the step was created.
Date that the step was last modified.
Size of the job step log in megabytes (MB).
Job step log output.
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 job step log metadata for job steps that they own.
A. Returns job step log information for all steps in a specific job
The following example returns all the job step log information for the job named Weekly Sales Data Backup.
USE msdb ; GO EXEC dbo.sp_help_jobsteplog @job_name = N'Weekly Sales Data Backup' ; GO
B. Return job step log information about a specific job step
The following example returns job step log information about the first job step for the job named Weekly Sales Data Backup.
USE msdb ; GO EXEC dbo.sp_help_jobsteplog @job_name = N'Weekly Sales Data Backup', @step_id = 1 ; GO