The way to control your sql-server related services
2008-05-01 09:38
531 查看
Sometimes you want to detect whether a service is running, and if not, you want to run it. Here is what you can do for the Sql Server Agent Service:
EXEC master.dbo.xp_ServiceControl 'QUERYSTATE','SQLServerAgent'
EXEC master.dbo.xp_ServiceControl 'START', 'SQLServerAgent'
But, xp_ServiceControl is undocumented and unsupported; its behavior could change with a service pack or the next release of SQL Server. So now I am looking for some better solutions....
If you know, please tell me.
EXEC master.dbo.xp_ServiceControl 'QUERYSTATE','SQLServerAgent'
EXEC master.dbo.xp_ServiceControl 'START', 'SQLServerAgent'
But, xp_ServiceControl is undocumented and unsupported; its behavior could change with a service pack or the next release of SQL Server. So now I am looking for some better solutions....
If you know, please tell me.
相关文章推荐
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio
- SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- What is the best way to paginate results in SQL Server
- MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
- ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- The best way to Debugging SQL Server 2005 Stored Procedures in Visual Stuido.2005
- Introduction to the SQL Server Analysis Services Logistic Regression Data Mining Algorithm