Using xp_serviceControl , Parameter1 excepts the following Start Stop Pause Continue Querystats Parameter 2 can be any service name print 'checking MSSQL service' exec master .. xp_servicecontrol 'QueryState' , 'MSSQL' print 'checking SQLAgent service' exec master .. xp_servicecontrol 'QueryState' , 'SQLAgent' print 'checking MSFTESQL service' exec master .. xp_servicecontrol 'QueryState' , 'MSFTESQL' print 'checking msdtc service' exec xp_servicecontrol N'querystate' , N'msdtc' print 'checking Sql Browser service' exec xp_servicecontrol N'querystate' , N'sqlBrowser' This function can be easily used to start ,stop ,pause and check the status of different services in Sql Server. Enjoy
This blog is to, share the encounters and learning’s of Sql Server