I am normally using SQL Server 2012 Management Studio to restore a SQL Server database from a "bak" file. I do this by overwriting an existing database. In the "Options" page, there is a check-box labeled "Close existing connections to destination database", which I mostly check because the target database is always "in use", even if I just restarted the MS SQL Service and I am sure that there are no applications using it.
Anyway, on my client's computer, I saw that that checkbox to close existing connections is grayed out without any information. How and why does this happen? A google search didn't yield any results.
Right-click on a database in SSMS and choose delete. In the dialog, check the checkbox for "Close existing connections." Click the Script button at the top of the dialog.
To disconnect the connection after the query completes, from the menus go to Tools > Options > Query Execution > SQL Server > Advanced and select "Disconnect after the query executes". By checking this option, after the query executes the database connection will be disconnected.
In more recent versions of SQL Server Management studio, you can now right click on a database and 'Take Database Offline'. This gives you the option to Drop All Active Connections to the database.
I had the same issue. I simply checked the Checkbox BEFORE choosing the source to restore from. After choosing the source the CB was grey but checked and the restore worked fine.
right click on database-> properties-> Options-> change Auto Update statistics Asynchronously to false. it will solve close existing connections to destination database grayed out issue
I hope it help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With