April 24, 2007 at 12:36 pm
Is there a way to start up a service after I start SQL Server?
One of our services is dependent on SQL. When I reboot the box the service tries to connect to SQL. If SQL is not ready to accepts connection at that time the service errors out and does not restart. Can I setup a proceudre to run everytime SQL Server restarts. And have that procedure do some sort of xp_cmdshell that starts the service or sends a net send command to start the service.
Thanks
-WM
April 24, 2007 at 12:39 pm
Hi Will,
You can set up a service dependency (http://support.microsoft.com/kb/193888) - you should make sure that you check the restart options etc via the services control panel once you have set up the dependency.
- James
--
James Moore
Red Gate Software Ltd
April 24, 2007 at 3:21 pm
You can use system procedure sp_procoption (@sp_name)
where @sp_name is stored procedure name that server will start right after the reboot. You can put your xp_cmdshell commend in that stored procedure.
April 24, 2007 at 4:18 pm
thanks for you help guys
Creating the procedure and using xp_cmdshell worked perfect.
Thanks again
-WM
DBA
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply