I got a nice new fresh pc and installed SQL Server Management Studio on it. I have a \"problem\" that when I am inactive for about 30 minutes that I lose connection to the d
One of the reasons why SSMS disconnects is related to the power management of the system, which requires to be adjusted from device manager
network adapters for both W-LAN
and LAN
Power Management tab and set allow the computer to turn off this device to save power to unchecked.
Another adjustment to do is to set the connection time-out option to zero which indicates no time-out and set the same for execution time-out if not already set.
Well this may have some different causes.
First of all, I just guess that - since you mentioned your fresh new PC and the fact that you installed it on your own - means that it's your private PC, right? In this case, I think you probably run a SQL Server Express on your local machine, right?
If the above is correct, I would suggest the following things to check.
AUTO CLOSE
of your database. This may cause such a behavior. You can check it in your properties of your Database. Anyway I would suggest to disable it. You can achieve this using the following code:
ALTER DATABASE [yourDatabase] SET AUTO_CLOSE OFF WITH NO_WAIT
user instance timeout
. You can check it using the following code:
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'user instance timeout'
You can configure this property by calling:
sp_configure 'user instance timeout', 1440;
RECONFIGURE;
The above statement will set the timeout to 1 day.
If you are running a real instance on another server and just try to connect to the instance using your new PC, one of the following options may help you:
It may be that your new PC has some power settings which will disable your network card after some time of inactivity. This may occur. I had the same option in my network interface. Just check it on your hardware manage and go through your options. In my case (Intel) it was very hidden in a sub-sub-sub-sub-dialogue. It causes a power safe mode after 10 minutes of inactivity. Which was great for the performance on my laptop, but not if I run big queries.
It may be a bad DHCP configuration. I had a similar problem in a hotel where my laptop cycled every 10 minutes and get a new IP-Address. This was very harmful on some systems. But I don't know how the SQL Server would handled it, I haven't connected to my companies SQL Server over the Hotel WLAN (of course!). :-D
Hopefully one or two of the options help you to fix your issue.