Moving SQL tempdb Database in SQL 2005
October 17, 2008 by John Tran · Leave a Comment
- Launch SQL Server Management Studio and Log onto Server
- Determine the logical file names for the tempdb database by using sp_helpfile as follows, click on New Query and run following script
use tempdb
go
sp_helpfile
go
The logical name for each file is contained in the name column. This example uses the default file names of tempdev and templog. - Use the ALTER DATABASE statement, specifying the logical file name as follows:
use master
go
Alter database tempdb modify file (name = tempdev,
filename = ‘New_Drive:\New_Path\tempdb.mdf’)
go
Alter database tempdb modify file (name = templog,
filename = ‘New_Drive:\New_Path\templog.ldf’)
go - Stop and Restart SQL Server Service