Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Auto-Close option when creating a new database in SQL Server 2008?

What is the Auto-Close option when creating a new database in SQL Server 2008?

EDIT: and how do you decide whether to turn it on or off?

like image 676
Brian Avatar asked Dec 06 '25 06:12

Brian


2 Answers

From MSDN:

If True, the database is closed, and its resources are freed when no user connection accesses the database. If False (default), the server maintains the database in an open and ready state regardless of user activity..

Edit to answer edited in question: It all depends on whether the server needs the extra memory, and if the time cost to open and close the database is worth the extra memory gained. If you are unsure, then false is probably the way to go.

like image 130
JoshJordan Avatar answered Dec 08 '25 20:12

JoshJordan


In short, don't enable it on production ever

Only enable if the database is accessed infrequently (such as Dev/QA)

like image 33
jerryhung Avatar answered Dec 08 '25 19:12

jerryhung