First, use the CREATE DATABASE MyDatabase command to CREATE a DATABASE MyDatabase (the DATABASE DATA file by default is C: \ Program Files \ Microsoft SQL Server \ MSSQL11 MSSQLSERVER \ MSSQL \ DATA);
Then, use the following command to change
The ALTER DATABASE MyDatabase
MODIFY the FILE
(
NAME=MyDatabase,
FILENAME='D: \ DATA \ MyDatabase2 MDF'
)
Finally, start the SQL server (mssqlserver) service or restart the computer (note: SQL server (mssqlserver) service changed several login account including administrator), displays MyDatabase) (restoration, and can not use, consult how to solve?
CodePudding user response:
Estimation is the permission problems, it is not recommended to put files in the root directory, since Windows 2008, the root directory permissions is a little special SQL Server 2016 ~ 2000 performance optimization, design QQ: 315054403 rural in jiaxingCodePudding user response:
In your description, there is no see mobile file operation, be sure didn't do? If you don't do, you will need to move files (this is not the modify automatically)CodePudding user response:
To detach will stop SQL server or database, mobile MDF/LDF files to D: \ DATA \, the last isThe ALTER DATABASE MyDatabase
MODIFY the FILE
(
NAME=MyDatabase,
FILENAME='D: \ DATA \ MyDatabase2 MDF'
)
Focused on the ERP/CRM development with the.net framework, C/S architecture, SQL Server + ORM (LLBL Gen Pro) + Infragistics WinForms
CodePudding user response:
The complete process is usually the1, modify the file
modify the file to the target position2. The database offline
3. Operating systems move files to the target position
4. The online database
CodePudding user response:
How do you solve?