This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
The EnumHistory method returns a QueryResults object that enumerates the execution history of all Microsoft SQL Server Agent jobs.
A QueryResults object that contains one result set defined by these columns.
System-generated identifier for execution attempt.
System-generated job identifier.
When applicable, text of a SQL Server message raised by the step.
When applicable, operator receiving e-mail notification of job completion.
When applicable, operator receiving network pop-up message notification of job completion.
When applicable, operator receiving page notification of job completion.
Number of times SQL Server Agent attempted execution of the step. 0 when the step executed successfully on the first attempt or no retry attempts specified for the job step.
Date on which execution occurred formatted as described in Remarks.
Execution duration expressed as a number of seconds.
Execution outcome interpreted using SQLDMO_JOBOUTCOME_TYPE.
Time at which execution occurred formatted as described in Remarks.
Target server name.
When applicable, the SQL Server message number of the message raised by the step.
When applicable, the severity of a SQL Server message raised by the step.
User-specified step identifier. The result set lists each job step and its outcome.
Job step name.
The result set column run_date represents the execution date as a scaled long integer. The integer is built as a sum of the year scaled by 10000, the month scaled by 100, and the day. For example, the date April 19, 1997 is represented by the long integer value 19970419.
The result set column run_time represents execution time as a scaled long integer. The integer is built as a sum of the hour scaled by 10000, the minute scaled by 100, and the seconds. The value uses a 24-hour clock. For example, the time 1:03:09 P.M. is represented by the long integer value 130309.
Membership in the result set is restricted using the optionally specified JobHistoryFilter object. For more information, see JobHistoryFilter Object.