Question : tempdb.mdf SQL 2008

I am runnig out of space on the Server hardisk. When I checked the files, I found out that "tempdb.mdf" is taking 80 Gb. The largest db I have is 5 gb. I don't understand why this file is so big. Any idea?

Answer : tempdb.mdf SQL 2008

There are many SQL Server operations that use tempdb to perform sorts and things like that.  Tempdb may bloat to very large sizes.  Restarting SQL Server will shrink tempdb since it's recreated every time SQL starts.  However, this may not be an option in your environment.

Best practice is to put tempdb on a separate disk and make sure it's adequately sized for your day to day operations.

FWIW, temp tables should be automatically destroyed when the connection that created them is dropped.  Table variables are good if you have the memory to support them.
Random Solutions  
 
programming4us programming4us