Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.2 KB

set-the-auto-close-database-option-to-off.md

File metadata and controls

29 lines (21 loc) · 1.2 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Set the AUTO_CLOSE Database Option to OFF
Check whether the AUTO_ CLOSE option is OFF. The AUTO_ CLOSE option has implications for performance in SQL Server.
VanMSFT
vanto
12/15/2023
sql
security
reference
Best Practices [Database Engine]

Set the auto_close database option to off

[!INCLUDE SQL Server]

This rule checks whether the AUTO_ CLOSE option is set OFF. When AUTO_CLOSE is set ON, this option can cause performance degradation on frequently accessed databases because of the increased overhead of opening and closing the database after each connection. AUTO_CLOSE also flushes the procedure cache after each connection.

Best practices recommendations

If a database is accessed frequently, set the AUTO_CLOSE option to OFF for the database.

For more information

ALTER DATABASE SET Options (Transact-SQL)

Related content