How to move system Databases – TEMPDB

first fire sp_helpfile to get the name and location of the files

use master
GO
sp_helpfile

ALTER DATABASE TEMPDB MODIFY FILE (
NAME = tempdev, FILENAME = 'E:\TEMPDB\tempdev.mdf'
)
ALTER DATABASE TEMPDB MODIFY FILE (
NAME = templog, FILENAME = 'E:\TEMPDB\templog.ldf'
)

It will only be reflected after SQL Server is restarted. Then you can delete those old tempdev.mdf and templod.ldf files to gain space.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>