If you write an odd query on your SQL server, you may have made your tempdb large. This can cause problems by filling your disk. While Tempdb stores temporary tables and cached information that helps with the performance of your server, you may want to shrink the table and allow it to rebuild – thus making your server perform better. Here’s a query that may help.
The apostrophe ‘ may need to be changed if you copy and paste this query.
DBCC FREESYSTEMCACHE (‘ALL’)
DBCC SHRINKDATABASE(tempdb, 10);
dbcc shrinkfile (‘tempdev’)
dbcc shrinkfile (‘templog’)
SELECT name, size
WHERE database_id = DB_ID(N’tempdb’);