Monitor Sql Server Services:
exec xp_servicecontrol 'querystate','mssqlserver'
exec xp_servicecontrol 'querystate','sqlserveragent'
exec xp_servicecontrol 'querystate','sqlbrowser'
exec xp_servicecontrol 'querystate','msdtc'
exec xp_servicecontrol 'querystate','MSSQLserverOLAPservice'
exec xp_servicecontrol 'querystate','Reportserver'
--Output :
------------------------------------------------------------------------------------------------------------------------------------
Running.
(1 row(s) affected)
For non sql services:
exec xp_servicecontrol ‘querystate’,'DHCPServer'
Start and Stop Sql services:
exec xp_servicecontrol ‘START’,'mssqlserver'
exec xp_servicecontrol 'STOP','sqlserveragent'
Hope above query will be useful to check sql server services state without service console help.
No comments:
Post a Comment