How to Shrink Temp DB in SQL

  1. CHECKPOINT; GO DBCC DROPCLEANBUFFERS; GO
  2. DBCC FREEPROCCACHE; GO
  3. DBCC FREESYSTEMCACHE ('ALL'); GO
  4. DBCC FREESESSIONCACHE; GO
  5. DBCC SHRINKFILE (TEMPDEV, 20480); GO if this fails restart the SQL Server Service and try again.
Creation date: 1/10/2018 11:25 AM ()      Updated: 1/10/2018 11:27 AM ()