Move TempDb Files to a New Location
23. 10. 2024
SELECT ‘ALTER DATABASE [tempdb] MODIFY FILE ‘ + CHAR(13) + ‘ (NAME = [‘ + [name] + ‘], FILENAME = ”D:\NewPath\’ + [name] + CASE [type] WHEN 1 THEN ‘.ldf’ ELSE ‘.mdf’ END + ”’);’ FROM [sys].[master_files] WHERE [database_id] = DB_ID(N’tempdb’)