To move tempdb as an example:
--------------------------------------------------------------------------------------------------------------- ------------
The first step:
Use ALTER DATABASE modify file to specify a new physical file location
Example
ALTER DATABASE tempdb
Modify file (name = ' tempdev ', filename= ' E:\Software\SQLServer_2012\ instance root \mssql11. Mssqlserver\mssql\data\db\tempdb.mdf ');
Go
Step Two:
Restart MSSQLServer
net start MSSQLSERVER
net stop MSSQLSERVER
Step Three:
Did you change the test?
Use tempdb;
DBCC SHOWFILESTATS;
Go
This has been successful!
--------------------------------------------------------------------------------------------------------------- -----------------
Attention:
Maybe you don't succeed when you do it, it could be a privilege issue.
1, ensure that you run the program as an administrator.
2. Ensure that you have complete control over the document. Here's how: File----and--------full control.
SQL Server Mobile System database location (non-master)