Tag: sql agent

  • T-SQL Stored Procedure to Get the Last Job Run Time and Status

    [sourcecode language=”sql”] /* Stored procedure to run the last run time and run satus of a SQL job. SQL Version: 2005+ Last modified on 2013-07-03 by Nick Xu –Usage –returns the last successful run time exec sp__GetLastJobRunTimeStatus @jobname = N’syspolicy_purge_history’, @status = N’success’ –returns the last failed runtime exec sp__GetLastJobRunTimeStatus @jobname = N’syspolicy_purge_history’, @status =…