Moving a mdf and log file from C:\ to another drive
Posted on 2014-11-10
I inherited responsibility for a SQL Server not long ago, and have been migrating a bunch of Access back-ends to the server. This has been working well.
This morning, the C:\ drive on the server was "full", so I started digging and found an old database that is still in use, but which was installed in the C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA folder rather than on the network server. Apparently, our accounting department has been adding data to this database and it and the ldf file are taking up nearly 50 on that computer.
How do I go about detaching that mdf and ldf, moving those files to the another drive, and then reattach it?