9.27.2013

SQL Server - Recovering TempDB Space

-- STEP 01 ALTER FILE SPECS =====================================
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, SIZE=100Mb);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, SIZE=100Mb);
GO


-- STEP 02 SHRINK FILES ========================================
USE tempdb
GO
DBCC shrinkfile (tempdev, 100)
GO
DBCC shrinkfile (templog, 100)
GO


http://www.sqldbadiaries.com/2010/11/13/tempdb-please-allow-me-to-shrink-you/
http://www.dbadiaries.com/how-to-shrink-tempdb
http://support.microsoft.com/kb/307487
http://technet.microsoft.com/en-us/library/ms175527(v=SQL.105).aspx