C-NET :: PROJECTS

cat shrinking-the-ms-sql-server-tempdb.md

Shrinking the MS SQL Server "tempdb" (when it won't shrink)

Posted

The tempdb database often won't just shrink when you ask it to, through SSMS or otherwise. Apparently, Sql Server holds on to it for its cache entries.

To shrink the table anyway (and have the cache reload), this should do:

DBCC FREEPROCCACHE
DBCC FREESYSTEMCACHE ('ALL')
DBCC SHRINKDATABASE ('tempdb', 0)
sql

Enjoy :)

Comments