Search code examples
sqlsql-server-2008-r2jobs

Fetching the duration of Current running SQL Server JOB


Fetching the duration of currently runnig Job in SQL Server.

exec msdb..sp_help_job @execution_status = 1
exec xp_sqlagent_enum_jobs 1, garbage

These stored procedure only return "last_run_time" which is the last time the job ran.


Solution

  • msdb.dbo.sysjobs master.dbo.sysprocesses

    I achieved this result by joining the above mention tables and getting login time from the processes.