Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Service Dependency for SQLServer

Status
Not open for further replies.

swade61970

Programmer
Apr 2, 2003
19
0
0
US
I have a VB.Net windows service that gets started automatically when a server gets rebooted. Problem is that the first thing the service does is connect to a SQL Server database. Without putting code in my program to loop or wait, I'm at a lost.

I was hoping for a SQLServer service that I could use as a dependent service. I spoke with our SQL Server administrator and he said that there are instances of SQL Server that get started by Enterprise Manager. He didn't know of a SQL Server service that gets started. Even if there was, it might not mean that the instance of the SQL Server I'm looking for is started yet.

Any suggestions?
 
The only service I see is the SQL Server Agent, which is used to automatically run scheduled tasks within SQL Server (DTS jobs, etc). Mine is not running because I don't use it presently.

I think you'll have to iterate through the list exposed by the .net Process class, looking for SQL Server instances. Or possibly make a WMI query.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top