我在晚上在SQL Server 2008数据库上运行维护计划,以重新组织索引和缩小数据库。 虽然这个计划正在运行一个我build立的Windows服务,查询数据库一直超时失败。
如何从维护计划中停止Windows服务?
您可以使用xp_cmdshell SP发出net stop <service_name>然后net start <service_name>
net stop <service_name>
net start <service_name>