Home Forums SQL Server 2014 Administration - SQL Server 2014 I HAVE TO WRITE ONE STORE PROCEDURE THAT EVERY MIN IT HAS TO CHECK MY SQL INSTANCE IS UP AND RUNNING IF NOT IT HAS TO SEND MAIL. PLEASE HELP ME HOW TO WRITE RE: I HAVE TO WRITE ONE STORE PROCEDURE THAT EVERY MIN IT HAS TO CHECK MY SQL INSTANCE IS UP AND RUNNING IF NOT IT HAS TO SEND MAIL. PLEASE HELP ME HOW TO WRITE

  • Jeff Moden (8/24/2014)


    Steve Jones - SSC Editor (8/24/2014)


    Please don't use all caps. It is equivalent to yelling. Also please don't cross post (removed the other one).

    You don't want to do this in SQL Server. [font="Arial Black"]Use Windows at the service level to check if the service is running[/font], and if not, send an email that way.

    How would one do such a thing?

    As a bit of a side bar and a play on words, "Just because you can do something in SQL Server, doesn't mean you SHOULDN'T"! 😉

    Windows will monitor service status and can take action when something stops, just like an alert in SQL Server. It's easy to script this to notify you. You can also have this alert in the Event logs, which means any monitoring system will pick it up.

    http://social.technet.microsoft.com/Forums/windowsserver/en-US/6ee23534-01ba-454b-b823-15fb243a51f7/how-to-send-email-msg-if-a-windows-service-stops?forum=winservergen