Knowledge Base

How to move tempdb files


1st, identify the current file location Use tempdb Go Sp_helpfile 2nd, identify which file you want to move – use the following command to move each file USE master;
GO
ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'T:\MSSQL\DATA\tempdb.mdf');
GO
ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'T:\MSSQL\DATA\templog.ldf');
GO