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
Many things you need :
- An account in the local administrator group
- An SQL Server instance
- SQL Server Management Studio
- 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 :
C:Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATA
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 windowsbulletin.com. 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