Move tempdb on MSSQL Server 2008

Moving tempdb to another disk. 

USE master
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'D:\tempdb\tempdb.mdf');
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\tempdb\templog.ldf');

Restart SQL service and check:

USE tempdb;
EXEC sp_helpfile

Expected output:

name fileid filename
tempdev 1 D:\tempdb\tempdb.mdf
templog 2 E:\tempdb\templog.ldf

Leave a Reply

Your email address will not be published. Required fields are marked *