SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Nightly Failed Jobs Report


Nightly Failed Jobs Report

Author
Message
Greg Larsen
Greg Larsen
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4167 Visits: 290
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/glarsen/failed_jobs.asp

Gregory A. Larsen, MVP
Andy Warren
Andy Warren
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: Moderators
Points: 24547 Visits: 2746
Greg, thats a great idea, wish I had thought of it! Im getting to that point, lots of jobs and lots of email, and beyond that processes that run on various non SQL machines that still have to be monitored. This is a good start. Only question I had was do you need global temp table rather than plain?

Andy
http://www.sqlservercentral.com/columnists/awarren/

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Dave Green
Dave Green
Valued Member
Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)

Group: General Forum Members
Points: 65 Visits: 1
quote:
Only question I had was do you need global temp table rather than plain?

Andy



I have found that xp_sendmail does not like accessing standard temp tables that were created outside of it. I presume that this is caused by xp_sendmail running as a seperate connection, and therefore being unable to access the temp table that the job has created. I find that a similar problem occurs with variables.

Have you any suggestions as to how this difficulty might be overcome? (or, failing that, a better understanding of what might be causing this?)

Dave.



Greg Larsen
Greg Larsen
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4167 Visits: 290
Dave's explaination is exactly the reason why I used a global temp table.

Dave I think you are right on regarding a different connection. I think this is because you could be logged on as user "XYZ123", but when you run xp_sendmail it runs under the MSSQLSERVER account to send the mail. Therefore a new connection "must" be established to send the mail.

-------------------------
Gregory Larsen, DBA

If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

Gregory A. Larsen, MVP
netgroper
netgroper
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 1
Greg

I required a similar solution to monitor failing jobs, but across multiple SQL Servers. I ended up writing a script using SQLDMO to get this done. I don't think you would be able to do this using TSQL unless you used linked servers (which wasn't possible in my environment).

Good article.
Regards
Julian



Greg Larsen
Greg Larsen
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4167 Visits: 290
Good Idea. I'm working on retrofitting my report process and other automated DBA process to run from a single server and monitor multple servers. I also am having problems getting it to work across all our servers. Maybe I'll consider re-writing in SQLDMO. Thanks for the tip.....

Gregory Larsen, DBA

If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

Gregory A. Larsen, MVP
Betsy Rogers
Betsy Rogers
SSC-Enthusiastic
SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)

Group: General Forum Members
Points: 162 Visits: 1
We do a similar thing - check several different servers for failed jobs nightly. We have one job on a master server that queries MSDB on the other servers (yes, we use linked servers). Each step in the job runs the query on a different server and appends the results to a text file. The last step is to mail the text file.

It's simplistic, but pretty easy to maintain and use. If anyone wants the code, let me know.

Betsy
birdies95@hotmail.com



Andy Warren
Andy Warren
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: Moderators
Points: 24547 Visits: 2746
If its not too long, post the code here, or you can add to the script library.

Andy
http://www.sqlservercentral.com/columnists/awarren/

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
TomBrattin
TomBrattin
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1920 Visits: 9
We do the same thing with a DTS package that uses an ActiveX script to log into each of our 41 servers and query msdb. The results are written out to our web server so I just need to look at the web page each morning. No linked servers necessary.



Greg Larsen
Greg Larsen
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4167 Visits: 290
Looks like lots of good methods to accomplish the samething.

Betsy - I would like the script that uses the linked servers.

Gregory Larsen, DBA

If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

Gregory A. Larsen, MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search