Re: Is there a reliable way to do this?





What is a reliable way to check to ensure that all system DBs are
started when SQL Server (SQL Express) starts up?

I am using SQL Express 2005 for a desktop application in which the user
requires the application be started at windows log-in time (so that
nothing is ever visible on the desktop except the application.)
Starting the application involves opening connections to two application databases.

When the application is started from the user's startup folder - that
is, right after log-in - there are often login failures reported by
..NetSQLClientData Provider - "Cannot open database [dbname] requested
by the login. The login failed. Login failed for user ...."

There are never any failures when started manually after login.

To deal with the things I THOUGHT might be causing this I made the
application check that the SQL Express service was running, and
increased the length of the connection time-out in the connection
string. Appears that these were not the cause of the problem. Examining
the SQL log shows that on startup, SQL Server has to start all its
internal databases. It looks like if this process is not complete
(usually it is the last db, tempdb, that isn't done with its startup)
my first connection fails. I suppose I could hardcode or put in the
configuration settings some sort of wait, or repeatedly try to open the
connection if the first time fails. But it seems like it would be safer to just know the status of the system dbs.

So, is there a way to do this?

Thanks!

Elizabeth





I think that there is really 2 approaches to this, one is to start sql
express prior to the application. That is to say, have the sqlexpress
service set to autostart (if this is feasible) If you do it this way the
service will be started and available by the time the logon screen comes
up otherwise if your already polling the service state and that's not working
im thinking that the only other real alternative would be to parse the
sql error log for the final "recovery complete" message. I would think
unless the user db's and/or tempdb database is rather large your probably
talking about milliseconds of timing on this issue.
-Allen


Posted by NewsLook (Trial Licence) from http://www.ghytred.com/NewsLook/about.aspx



.



Relevant Pages

  • RE: Getting Challenged when using SQL connection on .aspx page
    ... What would happen if i removed integrated security=sspi from the connection ... Just want the login token to be passed, ... Have webpage with following connection in the ... I have account to the database on the SQL server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: SQL Resets
    ... If it were SQL that was falling short, ... The default backlog for SQL Server is 5. ... System.InvalidOperationException: Internal connection fatal error. ... From time to time, under heavy loads, we are getting resets at ...
    (microsoft.public.sqlserver.connect)
  • Re: provider: Named Pipes Provider, error: 40 - Could not open a c
    ... I have tried connecting to Sql Management Studio and it worked pretty much ... An error has occurred while establishing a connection to the server. ... under the default settings SQL Server does not allow remote connections. ... I have a sql server install / database on the web server. ...
    (microsoft.public.sqlserver.connect)
  • Re: Permission question - another one
    ... If I add an Sql Login it does add the TRAVAC\ in front of the names, ... seems to be users that were setup to use SQL Server Authentication. ... RAPTOR is the Server that has SQL Server running on it. ... > " I could think I am taking permissions away from someone, ...
    (microsoft.public.sqlserver.programming)
  • Re: Renamed Windows login not found in SQL Server 2000
    ... It's almost like SQL tuck some knowledge away in an area ... of memory that only gets released on Windows stop. ... > I am running SQL Server 2000 SP2 with Windows ... > login gets corrupted) I am unable to add the new login to ...
    (microsoft.public.sqlserver.security)

Loading