--move tempdbalter DATABASE tempdb MODIFY FILE (name= ' tempdev ', filename= ' D:\Database\tempdb.mdf '); ALTER database tempdb MODIFY FILE (NAME = ' templog ', filename= ' F:\Logs\templog.ldf ');--move modelalter DATABASE model MODIFY FILE (name= ' Modeldev ', filename= ' F:\SYSTEM_DB\model.mdf '); ALTER Database Model MODIFY FILE (name= ' Modellog ', filename= ' F:\SYSTEM_DB\modellog.ldf ');--move msdbalter DATABASE msdb MODIFY FILE (name= ' msdbdata ', filename= ' F:\SYSTEM_DB\msdbdata.mdf '); ALTER DATABASE msdb MODIFY FILE (name= ' msdblog ', filename= ' F:\SYSTEM_DB\msdb_log.ldf ');
Move Master use url:https://technet.microsoft.com/en-us/library/ms345408 (v=sql.110). Aspx#master
--move tempdbalter DATABASE tempdb MODIFY FILE (name= ' tempdev ', filename= ' D:\Database\tempdb.mdf '); ALTER DATABASE tempdb MODIFY FILE (NAME = ' templog ', filename= ' F:\Logs\templog.ldf ');
--move modelalter DATABASE model MODIFY FILE (name= ' Modeldev ', filename= ' F:\SYSTEM_DB\model.mdf '); ALTER Database Model MODIFY FILE (name= ' Modellog ', filename= ' F:\SYSTEM_DB\modellog.ldf ');--move msdbalter DATABASE msdb MODIFY FILE (name= ' msdbdata ', filename= ' F:\SYSTEM_DB\msdbdata.mdf '); ALTER DATABASE msdb MODIFY FILE (name= ' msdblog ', filename= ' F:\SYSTEM_DB\msdb_log.ldf ');
Move System Databases in MS SQL SERVER