|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Saturday, January 19, 2013 8:28 AM
Points: 1,038,
Visits: 255
|
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, March 20, 2006 2:11 AM
Points: 59,
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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Saturday, January 19, 2013 8:28 AM
Points: 1,038,
Visits: 255
|
|
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
Need SQL Server Examples check out my website at http://www.sqlserverexamples.com
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, October 16, 2003 12:00 AM
Points: 1,
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
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Saturday, January 19, 2013 8:28 AM
Points: 1,038,
Visits: 255
|
|
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
Need SQL Server Examples check out my website at http://www.sqlserverexamples.com
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, September 14, 2005 11:02 AM
Points: 114,
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
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 4:58 PM
Points: 1,827,
Visits: 8
|
|
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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Saturday, January 19, 2013 8:28 AM
Points: 1,038,
Visits: 255
|
|
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
Need SQL Server Examples check out my website at http://www.sqlserverexamples.com
|
|
|
|