// sql server · vacuum, statistics & maintenance

AUTO_SHRINK

Periodically shrink data and log files with free space.

Default
OFF
Range
ON, OFF
Restart needed
No
Default checked on
SQL Server 2025

What it does

A background task shrinks files with more than 25% free space. The space is usually needed again, so files grow and shrink repeatedly, and shrinking data files fragments indexes.

Default value

OFF. OFF (SQL Server 2025).

Check the current value

SELECT name, is_auto_shrink_on
FROM sys.databases
WHERE name = DB_NAME();

Change it

ALTER DATABASE CURRENT SET AUTO_SHRINK OFF;

No restart; takes effect immediately.

When to change it

Never turn it on. If you find it on, turn it off.

What can go wrong

Index fragmentation, repeated growth events and wasted I/O.

Questions about AUTO_SHRINK

What is the default value of AUTO_SHRINK in SQL Server?

OFF. OFF (SQL Server 2025).

Does changing AUTO_SHRINK require a restart?

No. No restart; takes effect immediately.

When should I change AUTO_SHRINK?

Never turn it on. If you find it on, turn it off.

Back to all SQL Server settings, or check the SQL Server manual for every option.

// one client for every engine

Check AUTO_SHRINK on your own server

SQLly runs the query above against SQL Server and the other engines in this reference, from one desktop app on macOS, Windows and Linux.