dbTalk Databases Forums  

SQL Agents jobs running at a point in time

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SQL Agents jobs running at a point in time in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SullivanYee
 
Posts: n/a

Default SQL Agents jobs running at a point in time - 08-15-2006 , 10:06 AM






Has anyone written a script or know of a script I could run to tell me what
SQL Agents jobs were running at a given point in time?

Thanks in advance,

Mark



Reply With Quote
  #2  
Old   
Norman Kelm
 
Posts: n/a

Default Re: SQL Agents jobs running at a point in time - 08-15-2006 , 10:17 AM






Sullivan,

SELECT DISTINCT job.name
FROM msdb..sysjobhistory AS jh
JOIN msdb..sysjobs AS job
ON jh.job_id = job.job_id
AND jh.run_status = 4 -- In Progress

Look at the BOL for the sysjobhistory table to see the other values of
run_status.

Norman

get DTS Package Search at http://www.gerasus.com/

SullivanYee wrote:
Quote:
Has anyone written a script or know of a script I could run to tell me what
SQL Agents jobs were running at a given point in time?

Thanks in advance,

Mark



Reply With Quote
  #3  
Old   
SullivanYee
 
Posts: n/a

Default Re: SQL Agents jobs running at a point in time - 08-15-2006 , 10:32 AM



Actually I am looking for jobs that ran in the past for example at '20060812
12:45'


"Norman Kelm" <norman (AT) no-spam (DOT) gerasus.com> wrote

Quote:
Sullivan,

SELECT DISTINCT job.name
FROM msdb..sysjobhistory AS jh
JOIN msdb..sysjobs AS job
ON jh.job_id = job.job_id
AND jh.run_status = 4 -- In Progress

Look at the BOL for the sysjobhistory table to see the other values of
run_status.

Norman

get DTS Package Search at http://www.gerasus.com/

SullivanYee wrote:
Has anyone written a script or know of a script I could run to tell me
what SQL Agents jobs were running at a given point in time?

Thanks in advance,

Mark



Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SQL Agents jobs running at a point in time - 08-15-2006 , 02:36 PM



You could still look at the same table but you will need to look at it a
litttle differently

run_date
int
Date the job or step started execution. For an In Progress history,
this is the date/time the history was written.

run_time
int
Time the job or step started.

run_duration
int
Elapsed time in the execution of the job or step in HHMMSS format.



These three columns should help you get the information you need

--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



"SullivanYee" <SullivanYee (AT) rcn (DOT) com> wrote

Quote:
Actually I am looking for jobs that ran in the past for example at
'20060812 12:45'


"Norman Kelm" <norman (AT) no-spam (DOT) gerasus.com> wrote in message
news:WzlEg.6847$o27.532 (AT) newssvr21 (DOT) news.prodigy.com...
Sullivan,

SELECT DISTINCT job.name
FROM msdb..sysjobhistory AS jh
JOIN msdb..sysjobs AS job
ON jh.job_id = job.job_id
AND jh.run_status = 4 -- In Progress

Look at the BOL for the sysjobhistory table to see the other values of
run_status.

Norman

get DTS Package Search at http://www.gerasus.com/

SullivanYee wrote:
Has anyone written a script or know of a script I could run to tell me
what SQL Agents jobs were running at a given point in time?

Thanks in advance,

Mark





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.