I am trying to write a SQL query which tell me if a SQL job has run or not based on its schedule. For instance, if a job was planned to run at 12:00PM and we are 12:05PM and it still hasn't run, I want to know that. What would be the best approach to detect that?
It happened in the past that we had SQL jobs to run periodically and SQL Server didn't run them. To prevent that, we would like to run a query against SQL Server 2008 R2 and check if the job ran or not and then trigger an alert if it hasn't run.
Thanks for the help!