June 3, 2010 at 3:53 am
Hi All,
pls pls reply for my question.
how to capture audit task (taskname,taskstarttime,taskendtime)
omn succcess of the tasks in package.
thanks
Syamala
June 3, 2010 at 6:15 am
If you want to do it via T-SQL, you could use as a starting point:
USE msdb
GO
SELECT j.name,
h.step_name,
taskstarttime = CONVERT(DATETIME, Stuff(Stuff (run_date, 5, 0, '-'), 8, 0, '-') + ' ' + Stuff(Stuff(RIGHT('000000' + CONVERT(VARCHAR(6), run_time), 6), 5, 0, ':'), 3, 0, ':')),
taskendtime = CONVERT(DATETIME, Stuff(Stuff (run_date, 5, 0, '-'), 8, 0, '-') + ' ' + Stuff(Stuff(RIGHT('000000' + CONVERT(VARCHAR(6), run_time), 6), 5, 0, ':'), 3, 0, ':')) + CONVERT(DATETIME, Stuff(Stuff(RIGHT('000000' + CONVERT(VARCHAR(6), run_duration), 6), 5, 0, ':'), 3, 0, ':'))
FROM sysjobs j
LEFT JOIN sysjobhistory h
ON j.job_id = h.job_id
ORDER BY run_date,
run_time
Thomas Rushton
blog: https://thelonedba.wordpress.com
June 3, 2010 at 6:29 am
popuri.s09 (6/3/2010)
Hi All,pls pls reply for my question.
how to capture audit task (taskname,taskstarttime,taskendtime)
omn succcess of the tasks in package.
thanks
Syamala
Aren't these the same question?
http://www.sqlservercentral.com/Forums/Topic931952-391-1.aspx
http://www.sqlservercentral.com/Forums/Topic931956-391-1.aspx
Thomas Rushton
blog: https://thelonedba.wordpress.com
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply