How to move the Microsoft SQL Server database to another disk partition

RECOMMENDED: Click here to fix Windows errors and optimize system performance

The information is stored somewhere. Sometimes it is not suitable for the original location. If you have little space, add a new disk array or are just curious, it’s a simple procedure to move a database in Microsoft SQL Server to that new desired location. It is clear that best practice procedures must be maintained for the DB’s proper investment. It is always a good idea to separate your databases to allow maximum I/O.

Moving the Microsoft SQL Server database

January 2021 Update:

We now recommend using this tool for your error. Additionally, this tool fixes common computer errors, protects you against file loss, malware, hardware failures and optimizes your PC for maximum performance. You can fix your PC problems quickly and prevent others from happening with this software:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.


Many things you need :

  1. An account in the local administrator group
  2. An SQL Server instance
  3. SQL Server Management Studio
  4. SA privileges for your SQL Server

This would probably work :

Locate the directory of your SQL database you want to move. By default (which is not good practice) the location of your databases is here :


Program filesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATA

Unlike yours, this one is here. I’d check, but if you’re ridiculously confident, don’t bother.

Go to the SQL Server Management Studio. Find the database you want to move and right-click the bad guy. Move the mouse down a little until you reach Tasks. Bring up this menu and click Disconnect.

This window appears. If there are active connections, it is probably best to tell these users to hurry, as they are busy doing nerd work to be more productive. If they refuse, there’s a checkbox to throw them out. I tend to check that box anyway.

Then click OK.

Okay, go back to the directory where the database is located. Select the.MDF and LDF files. Cut it out and paste it into the new position, noting the new position as you need it.

It may therefore take some time to copy it to its new location. Find something else to do in the meantime. There would be no harm in reading several other articles from the Once there, return to the SQL Server Management Studio. Right-click the database folder, then click Attach Attach.

Locate the new location of your database, select the database and click OK.

Click OK. Click OK in the next window. Press the F5 key to update the SQL window. If your database is available, you did a good job. Otherwise…….there is always an event display.

Link of interest: SQL Server downloads via Microsoft.

Guest contribution : Greg Partlow

RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance

Related Video