??SQL Server???????????????
???????????? ???????[ 2013/2/4 14:02:20 ] ????????
???????????????????????????????????????????????????δ???????????2005????????2000????е???????????????????????????Ч????
??????????????????????У?run_duration?????г?????????????????int????????run_time???????????
SELECT j.name AS 'JobName' ??
run_date ??
run_time ??
msdb.dbo.agent_datetime(run_date?? run_time) AS 'RunDateTime' ??
run_duration
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobhistory h ON j.job_id = h.job_id
WHERE j.enabled = 1 --Only Enabled Jobs
ORDER BY JobName ??
RunDateTime DESC
??????????£?
??????????λ?????????????3λ?????????????????????????????????????????????????????????????????????洢????????????У?????????????д?????????????????????????
SELECT j.name AS 'JobName' ??
run_date ??
run_time ??
msdb.dbo.agent_datetime(run_date?? run_time) AS 'RunDateTime' ??
run_duration ??
( ( run_duration / 10000 * 3600 + ( run_duration / 100 ) % 100 * 60
+ run_duration % 100 + 31 ) / 60 ) AS 'RunDurationMinutes'
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobhistory h ON j.job_id = h.job_id
WHERE j.enabled = 1 --Only Enabled Jobs
ORDER BY JobName ??
RunDateTime DESC
???????????????????????????????????????????
??????????ETL?????????????к???裬??????????Щ?????????????????????????????msdb.dbo.sysjobsteps??
SELECT j.name AS 'JobName' ??
s.step_id AS 'Step' ??
s.step_name AS 'StepName' ??
msdb.dbo.agent_datetime(run_date?? run_time) AS 'RunDateTime' ??
( ( run_duration / 10000 * 3600 + ( run_duration / 100 ) % 100 * 60
+ run_duration % 100 + 31 ) / 60 ) AS 'RunDurationMinutes'
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobsteps s ON j.job_id = s.job_id
INNER JOIN msdb.dbo.sysjobhistory h ON s.job_id = h.job_id
AND s.step_id = h.step_id
AND h.step_id <> 0
WHERE j.enabled = 1 --Only Enabled Jobs
ORDER BY JobName ??
RunDateTime DESC
????????????????????鵽????????????????????????м????????????SQLServer ??????????к???????????????????????????????????????????????????????
?????????????м????????????????????????????????????????????????????????????????????????????????????????е?????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11