Added latest changes for SQL Agent - Refer v2

This commit is contained in:
Neeraj Kumar
2025-10-20 08:03:45 -04:00
parent 716014d0bf
commit 49a18b5c47
225 changed files with 10452 additions and 0 deletions

View File

@ -0,0 +1,21 @@
USE ProdDUTASJobSchedule;
GO
DECLARE @Runday DATE = DATEADD(day, +0, CAST(GETDATE() AS DATE)); -- -1 for Yesterday
SELECT
jeh.ExecutionID,
jeh.JobName,
jeh.RunDate,
jc.ScheduledStartTime,
jeh.ActualStartTime,
jeh.ActualEndTime,
jeh.Status,
jeh.ErrorMessage,
jeh.OverrideFlag,
jeh.OverrideBy
FROM dbo.JobExecutionHistory jeh
INNER JOIN dbo.JobControl jc
ON jeh.JobName = jc.JobName
WHERE jeh.RunDate = @Runday
ORDER BY jc.ScheduledStartTime, jeh.ActualStartTime;