Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQLagent job name
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

94 Posts

Posted - 05/24/2013 :  10:43:04  Show Profile  Reply with Quote

One of our DB server has several SQLagent jobs. I wanted to check the status of a backup and ran SP_whoisactive. It gave me the details which included "Program_name" which was cryptic:

SQLAgent - TSQL JobStep (Job 0x342E6E3096634D47B0C2308A83DF70B2 : Step 3)

Since there are many SQL agent jobs on the server, I wanted to find which job it's running so I can check what is step 3 and how many steps more to finish.

So, I used the following to get the ID for all the SQL agent jobs.

select * from msdb.dbo.sysjobs

But None of the job_IDs match the ID I got above. Shouldn't atleast one job match the result I got above "0x342E6E3096634D47B0C2308A83DF70B2".

Am I missing something here?

Any help is much appreciated

- Shiyam

Aged Yak Warrior

549 Posts

Posted - 05/24/2013 :  11:10:50  Show Profile  Reply with Quote
Try this command:

Select * from msdb.dbo.sysjobhistory
Go to Top of Page


5072 Posts

Posted - 05/24/2013 :  11:21:40  Show Profile  Visit russell's Homepage  Reply with Quote
I would modify MuMu's suggestion to this:
select top 100 * from sysjobhistory order by run_date desc;

Can also try this:
use msdb;

SELECT, s.step_id
FROM	sysjobs j
JOIN	sysjobsteps s
On	s.job_id = j.job_id
WHERE	command like '%backup%';
Go to Top of Page

Yak Posting Veteran

94 Posts

Posted - 05/24/2013 :  12:17:51  Show Profile  Reply with Quote
Thanks a MILLION guys!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000