Moving SQL tempdb Database in SQL 2005

October 17, 2008 by John Tran · Leave a Comment 

  1. Launch SQL Server Management Studio and Log onto Server
  2. 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.
  3. 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

  4. Stop and Restart SQL Server Service

About John Tran

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!