Disable Auto Close on a MS SQL Database

When a database has been created in any version of Microsoft SQL Express, the default setting for the AUTO_CLOSE is set to true. This causes the database to shut down after the connection to the database is closed. When the database is next accessed the database runs a CHECKDB to check the database consistency slowing down the start time of the web applicaiton.

The reason for this is to save resources on the PC or Server that MS SQL Express is installed on, as usually these PCs or Servers have minimal resources.

To check whether Auto_Close is ON or OFF for your database.

SELECT DATABASEPROPERTYEX('YourDatabaseName', 'IsAutoCLose');

To disable AUTO_CLOSE on your database you can run the following T-SQL command on the database:

Alter Database YourDatabaseName Set Auto_Close ON



  • 53 Users Found This Useful
Was this answer helpful?