您的位置:首页 > 数据库

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐