Removing TEMP DB in SQL Server
If you want to increase the space on your hard disk, a viable option is by removing TEMPDB in SQL Server. Use this query to removing tempdb in your sql server.
USE master
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = tempdev, FILENAME = ‘D:\TEMPDB.MDF’)
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = templog, FILENAME = ‘D:\TEMPLOG.LDF’)
Just change the “D” with another drive you like to save the tempdb and templog files. After executing query above, stop and restart your sql server. After the query created a new file, you may delete the old files to enlarge free space in your hard disk.
Tags: sql server, tips n tricks