SQL Server : Change TempDB location

This is no rocket science but today I needed to move the tempDB to another disk. This is something I though could be done by changing the location path on the database properties in the files tab. Well, bummer, the location was not editable there. So how can we do this… ?
Running this query will solve this for you :
USE
master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = ‘F:MSSQLDatatempdb.mdf’);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = ‘F:MSSQLDatatemplog.ldf’);
GO
Warning: count(): Parameter must be an array or an object that implements Countable in /customers/5/2/1/ksaelen.be/httpd.www/wordpresses/dynamicsaxblog/wp-includes/class-wp-comment-query.php on line 399

Leave a Comment Yourself

Your email address will not be published. Required fields are marked *