• Execute the following script in Query Editor to move the tempdb files into a new location:

    -- Moving tempdb to a new location

    -- Checkout current location and logical names

    USE tempdb

    GO

    EXEC sp_helpfile

    GO

    -- Setup the new location

    USE master

    GO

    ALTER DATABASE tempdb

    MODIFY FILE (NAME = tempdev, FILENAME = 'E:\sql\db\tempdb\tempdb.mdf')

    GO

    ALTER DATABASE tempdb

    MODIFY FILE (NAME = templog, FILENAME = 'E:\sql\db\tempdb\tempdb.ldf')

    GO

    /*

    Messages:

    The file "tempdev" has been modified in the system catalog. The new path will be used the next time the database is started.

    The file "templog" has been modified in the system catalog. The new path will be used the next time the database is started.

    */

    -- Reboot server

    -- After reboot, old tempdb files can be deleted