SQL Server 2008 R2 Express, service stopping on server

sql-server-2008-expresssql-server-express

I have a virtual windows server with SQL Server 2008 R2 Express. for the last couple of days When I get up in the morning and check my site, its down, as the SQLEXPRESS service is stopped.

I have never had this problem before and its very concerning. I have looked in the SQL server logs, under management but they offer no information, can anyone suggest a log that would be useful for this situation ?

when I try and connect to my DB through management studio I get this error –

A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible. Verify that the instance
name is correct and that SQL Server is configured to allow remote connections. (provider:
Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

when i restart the service I can connect and my site is back online.

looking at the SQLEXPRESS service, I have just set some recovery options so if it does fail, it will attempt to restart the service, and if on subsequent failures it will restart the machine, but this is just a safety net, I need to know what is causing it to stop.

some extra informaton that may be of some use.
i am using SQLCacheDependancy, so i have enabled the Broker on the database.

It seems to to be random and may be weeks before it happens.

Best Answer

I still don’t know why it was stopping but setting the recovery options for the SQLEXPRESS service to restart if the service fails has resolved the site from falling over. I has been fine so far. If I discover the cause I will post it here.