Earlier on today I really needed to see the last modified date of a job that had been disabled. I didn’t know whether it was recent change or whether it was in the distant past. SQL Server Agent Job screen doesn’t have a ‘last modified’ column, so where did I turn to?
The SYSJOBS in the MSDB. Running the following code against it will bring back all the information we need. The start date is to narrow down data returned, you could remove it if you wish:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
USE msdb; GO DECLARE @SearchDate DATETIME; SET @SearchDate = '01 JAN 2015' SELECT name, [enabled], date_created, date_modified FROM sysjobs WHERE date_modified >= @SearchDate AND enabled = 0 ORDER BY date_modified DESC; GO |
Leave a Comment