Home MS SQL Server DB Maintenance Move the tempdb database in MS SQL Server
Move the tempdb database in MS SQL Server E-mail
Written by Administrator   
Thursday, 15 January 2009 10:26

If you need to move the tempdb database after SQL Server is first installed,
run this script to move it to a more appropriate location:

USE master 
go 

ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'E:\tempdbname.mdf') 
go 

ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'E:\templogname.ldf') 
go

 

  • NAME refers to the logical name of the tempdb database and log files.
  • FILENAME refers to the new location of the tempdb files. 
  • You must restart the mssqlserver service before it takes affect.

 

Last Updated on Thursday, 15 January 2009 10:30