The transfer MSSQL database
The document translated automatically
The transfer MSSQL database
To change the location of the database files in MSSQL can do this with the command:
use master;
GO
ALTER DATABASE model
MODIFY FILE (NAME = modeldev, FILENAME = 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA \ Model.mdf');
GO
ALTER DATABASE model
MODIFY FILE (NAME = Modellog, FILENAME = 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA \ Modellog.ldf');
GO
use master;
GO
ALTER DATABASE msdb
MODIFY FILE (NAME = MSDBData, FILENAME = 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA \ MSDBData.mdf');
GO
ALTER DATABASE msdb
MODIFY FILE (NAME = MSDBLog, FILENAME = 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA \ MSDBLog.ldf');
GO
use master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA \ tempdb.mdf');
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA \ tempLog.ldf');
GO
This example changes the location of the database files from C: \ Microsoft SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA to 'F: \ Microsoft in SQL Server \ MSSQL10.MSSQLSERVER \ MSSQL \ DATA