views:

92

answers:

2

Hi

I have an application which has 3 services which are dependent on SQL server.

The database used by my application is present in another machine(different from machine where i have the 3 services).

These 3 services are dependent services for SQLserver.

I have established an ODBC Connection with my DB in remote machine and my services are running fine.

Now i terminate or stop the SQLserver in the machine where my services are running. Since my services are dependent services windows will stop my services also.

Question1: Is it possible for me to remove the dependency from services.msc for my services from properties of sqlserver.

Question2: Suppose i remove the dependency for my services and that i killed sqlserver exe will my services continue to work with the DB which is in a remote machine.

Thanks

+1  A: 

Answer1: You can add/remove dependancies using the sc command

Answer2: Yes. If you remove dependancy and kill local sql server, the services will run fine with remote sql server as long as the connection string is set properly

bdhar
Can you alter dependencies with `sc`? If so, how?
Jeremy McGee
http://www.kiwisyslog.com/help/cattools/index.html?appserv_howtoaddservdepends.htm
bdhar
sc config "service name" depend= ""
bdhar
The above command will remove all dependencies
bdhar
+1  A: 

Yes, it is possible to change the service dependencies by editing the registry:

  • Back up the registry.

  • Under the key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Service, you should find the name of the service.

  • Right-click on the DependOnService property and edit it as appropriate. Note that this is a CR-delimited string value.

  • Restart the service.

Jeremy McGee