Categories
MSSQL Server

MSSQL Move Tempdb Files

Move tempdb files to a different location.

USE MASTER
GO
ALTER DATABASE tempdb MODIFY FILE (name = tempdev, filename = 'D:\Path\To\tempdatafile.mdf')
GO
ALTER DATABASE tempdb MODIFY FILE (name = templog, filename = 'L:\Path\To\templogfile.ldf')
GO

Restart the database engine and check if the new files are created. For more information on file locations you can use the stored procedure sp_helpfile. Remove the files from the original location.