Check status of server

  • Does anyone have script to check the status of the server (sql server and sql server agent) if its up or down and

    notify if its down - Thanks a lot

  • This was removed by the editor as SPAM

  • You can try these extended stored procedures:

    declare @mssqlservice nvarchar(100),

        @sqlserveragent nvarchar(100)

     select @mssqlservice = 'mssqlserver',

            @sqlserveragent = 'sqlserveragent'

    exec master..xp_servicecontrol  N'QUERYSTATE', @mssqlservice

    exec master..xp_servicecontrol  N'QUERYSTATE', @sqlserveragent

    I don't think you can always do this. If the sql server is down, your query won't run. you can use another live SQL server and make distributed query.  

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply