Reputation: 2519
A job running on our SQL server failed. We are running MS SQL server 2005. While investigating, the following question came up: When was this process initiated on the server? Is there any query I can run that will give me this information?
Upvotes: 1
Views: 5047
Reputation: 48018
This should give you what you need
SELECT
Jobs.name,
StartTime = CONVERT
(
DATETIME,
RTRIM(run_date)
)
+
(
run_time * 9
+ run_time % 10000 * 6
+ run_time % 100 * 10
) / 216e4
,
endTime = CONVERT
(
DATETIME,
RTRIM(run_date)
)
+
(
run_time * 9
+ run_time % 10000 * 6
+ run_time % 100 * 10
+ 25 * run_duration
) / 216e4
FROM
msdb..sysjobhistory JobHistory
INNER JOIN msdb..sysjobs Jobs
ON Jobs.job_id = JobHistory.job_id
WHERE
JobHistory.step_name = '(Job outcome)'
Upvotes: 3
Reputation: 20327
using management studios, you can right click the job and click view history. this will containt the list of executions for the job.
Upvotes: 0