T-SQL Query to find currently running jobs | SansSQL

Sunday, August 18, 2013

T-SQL Query to find currently running jobs

Here is a T-SQL query to find the currently executing jobs.
The output of this query will be the list of jobs that are currently running along with the number of seconds it is been running.
SELECT  J.name as Running_Jobs,  
  JA.Start_execution_date As Starting_time,
        datediff(ss, JA.Start_execution_date,getdate()) as [Has_been_running(in Sec)]
FROM msdb.dbo.sysjobactivity JA
JOIN msdb.dbo.sysjobs J
ON J.job_id=JA.job_id
WHERE job_history_id is null
      AND start_execution_date is NOT NULL
ORDER BY start_execution_date


4 comments:

Anna Schafer said...

But it shows how we can join with labor now to plot the steps for a just transition from dependency on defense contracts for good paying union jobs to a local sustainable economy.Executive Employers Review

Kiquenet said...

I have found a job running from 2018. How can I delete it? How can I get more information about errors and steps?

Jenny said...

Watch and Download world's famous Turkish action drama Kurulus Osman Season 3 in English on link below
👇
Kurulus Osman Season 3

Kurulus Osman Season 3 Episode 1
On link below
Kurulus Osman Season 3 Episode 1

Crypto trading course
👇
Crypto quantum leap

YouTube course
Be a professional YouTuber and start your carrier.......,,,
Tube Mastery and Monetization by matt

DarenTill said...

Still do not know how to use the passive voice correctly when writing various text works? Then just try here! Follow the link to start using a specialized tool that will help identify such errors. It is easy to use, free and available to absolutely everyone. You can use it to check absolutely any texts!

Post a Comment

Ads