1.查询当前信息:
select name,physical_name from sys.master_files where database_id=db_id('tempdb')
2.更改位置
ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'E:\Data\tempdb.mdf');
ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'E:\Data\templog.ldf');
3.重启SQL服务