Discussion:
sql lost connection on local server every night
(too old to reply)
unknown
2013-01-15 13:06:09 UTC
Permalink
I have a local sql for testing 2008 rc2.
Everything is fine and running great.
UNTIL I go home in the afternoon.
when I get back the next day and try to run something I get the
connection icon and have to connect again.
This works for some windows as long as I dont' have any code doing
anything.
If I do I get because it does not exist or you do not have
permission.
I have tried restore last session and change connection and nothing
gets it back short of a shutdown and reboot of the server.

Why is this happening and what do I need to do to make it stay
connected?
unknown
2013-01-15 13:20:35 UTC
Permalink
I just noticed that some of the queries I was running have been
shifted from the database I was working on to master.
What would cause all these changes ?
Erland Sommarskog
2013-01-15 21:45:03 UTC
Permalink
Post by unknown
I have a local sql for testing 2008 rc2.
Everything is fine and running great.
UNTIL I go home in the afternoon.
when I get back the next day and try to run something I get the
connection icon and have to connect again.
This works for some windows as long as I dont' have any code doing
anything.
If I do I get because it does not exist or you do not have
permission.
I have tried restore last session and change connection and nothing
gets it back short of a shutdown and reboot of the server.
Why is this happening and what do I need to do to make it stay
connected?
Network glitches. A simple way to provoke this is to pull the network
cable and pull it back. Since TCP is a connected protocol a disconnection
means, well, a disconnection.
Post by unknown
I just noticed that some of the queries I was running have been
shifted from the database I was working on to master.
What would cause all these changes ?
SQL 2008 R2?

They meddled with the behaviour of a lost connection in SQL 2008 R2,
but they made it worse.

In old Query Analyzer, if you lost connection, it would re-connect
silently, and if the server again was available, you would not notice.
You got back to the database you was in.

In SSMS 2005, 2008 and 2012, you get an error message about "transport"
something on first occasion, and on next attempt you are back in the
database you came from.

In SSMS 2008 R2 they tried to save you from this "transport" error, but
when they silently put you in your default database it's not fun anymore,
and this obnoxious behaviour was removed in SQL 2012. I don't know if
it is fixed in SP2 of SQL 2008 R2.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
Loading...