Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006

    Unanswered: Check periodically if SQL server is running


    I have my SQL server installed and running on a windows 2003 server. Sometimes, the server stops unexpectedly. I want to know if there is any mechanism to alert as and when the SQL server or SQL server agent goes down.

    I guess everything is a windows service. Can we have a mechanism to test this service from a script and send an alert mail when the server goes down? How can this be done from a script?

    Thanks in advance


  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    If you have two servers, you could have each server send periodic commands to the other to see if they are awake.
    Or you could schedule a job to e-mail you at regular intervals and when you don't get a notification you'd know something was wrong.

    ...or you could fix the f'ing server...
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

  3. #3
    Join Date
    Nov 2004
    on the wrong server
    Provided Answers: 6
    set the services to autostart and you can use sp_procoption to send you an email everytime sql server restarts.

    you ought to figure out why your server is stalling out though.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  4. #4
    Join Date
    Jun 2003
    CA, USA
    You can also use EXECUTE xp_servicecontrol 'QueryState', 'SQLSERVERAGENT'

    Не дают котенку сала,
    Не дают и колбасы
    У него вся шерсть отпала,
    Повылазили усы...

  5. #5
    Join Date
    Aug 2006
    San Francisco, CA
    I think you should kick the server, that would fix it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts