SQL Server Relocate Tempdb file location
There might be time you would like to relocate tempdb file to a new location.
Make sure the SQL Server service account has required permission to the destination folder.
Run the following command to move each database file to the new location:
ALTER DATABASE tempdb MODIFY FILE (name = tempdev, filename = 'E:\Temp\tempdb.mdf') Restart SQL Server service and tempdb should be relocated to the new location.
If you encounter any issue that caused the SQL Server service fail to start, you can try to start the service in emergency mode and then connect to it make any required adjustment.
Posted by John Liu Sunday, June 18, 2023