Query SQL Server Job Tables

Who is online?  0 guests and 1 members
Home  »  Blogs  »  BradSchacht  »  Query SQL Server Job Tables
 
0
/5
Avg: 0/5: (0 votes)

Comments (4)

JEBacaniSQLDude

Good stuff, Brad!  But one question...

Was there a reason to use the GROUP BY?  I don't see a need for it, or is it a leftover from querying other aspects of the job history table?...  It seems the GROUP BY gave you the results in order, but wouldn't ORDER BY be more appropriate? 

Sorry if it sounds like I am nitpicking...

Cool

2/2/2011
 · 
 
by
BradSchacht
BradSchacht said:

JEBacaniSQLDude You are correct, this particular query probably doesn't need the GROUP BY.  However, there have been times when I have gotten duplicate steps listed in the results.  This may very well could have been from the other columns that I had in there as I was joining to other tables too.  At the time I was using this method for pulling the errors from different jobs.  An order by would definitely be appropriate here, be in instead of or in addition to.  I looked at the script that I have saved and that is in there but for whatever reason while I was editing stuff for this blog removed it.  Great catch!

You're definitely NOT nitpicking.  Very valid questions.  I have updated the script given here to add the ORDER BY and remove the Group By for this example.

Thanks for the feedback!

2/2/2011
 · 
 
by
sammy1188
sammy1188 said:
Great piece, exactly what I was looking for. One thing I did notice was the results dont show while the job is still running (and only shows after the job has completed). Is there a way to overcome this or just the limitation of the tool? In any event, thanks for sharing, saved me considerable time. Cheers Sam
6/10/2012
 · 
 
by
sammy1188
sammy1188 said:
Great piece, exactly what I was looking for. One thing I did notice was the results dont show while the job is still running (and only shows after the job has completed). Is there a way to overcome this or just the limitation of the tool? In any event, thanks for sharing, saved me considerable time. Cheers Sam
6/10/2012
 · 
 
by
Blogs RSS Feed

BradSchacht's latest blog posts

Blogs RSS Feed

Latest community blog posts