Sql-server – SQL Server Database Keeps Semi-Detaching Itself

sql serversql-server-2005sql-server-2008-r2ssms

Forgive me if I am not using all the proper terms but I have databases that will detach themselves from SQL Server. In SQL Server Management Studio the plus sign will be missing next to the database, or the database will have no tables.

Now the fix for this is easy, simply detach and attach the database and we're back up and running. BUT what is the cause for this?

Best Answer

You have "auto close" switched on probably

Turn it off: it isn't a good idea And again

ALTER DATABASE MyProblemDatabase SET AUTOCLOSE OFF;