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' ...
This blog is to, share the encounters and learning’s of Sql Server