MCITP

MCITP

Thursday, September 27, 2012

How to check status of SQL services using TSQL

To check the SQL Server services or any other service status using SSMS you can execute the extended stored procedure xp_servicecontrol. 

EXEC xp_servicecontrol N'Querystat|Start|Stop’,N'Service Name' 

E.g :- 

EXEC xp_servicecontrol N'querystate',N'MSSQLServer'
 
EXEC xp_servicecontrol N'querystate',N'SQLServerAGENT' 

No comments:

Post a Comment

Followers