You may want to move the SQL database files from one location on the server to another in order to free up space on a drive or move the database to a drive with more space on it.
For each database:
- Right-click the database and go to Properties
- Go to the Files page and note the path and file name for the files associated with the database.
- Locate the files on the server at this location.
- In SQL, right-click the database and choose Tasks -> Detach…
- Check the Message section to see if any connections currently exist. If they do, you may need to check the Drop Connection box next to the database name.
- Click OK to detach the database.
- Take the files located in step 3 and copy them to the new location specified by the customer on the same server.
- In SQL, right-click the Databases folder under the server name, and choose Attach…
- Click on Add… and locate the MDF file at the new location. Click OK.
- The Log file should appear in the Database Details section of the form under the Data file. Click on the ellipsis under Current File Path for the log file.
- Locate the LDF file at the new location. Select it and hit OK.
- Click OK to finish attaching.
- After making sure the database is now accessible, remove the MDF and LDF files from the original location.
Comments
0 comments
Please sign in to leave a comment.