Since I don’t do this very often, I always have to refresh my memory on the process. It is easily found via your favorite search engine, but since part of my reason for this blog is to consolidate the places I have to go to look for this kind of thing, I’m going to post it here. :)
- Document the current database permissions.
- Make sure there are no active connections to the database. Really, you need to do this.
- Check where the current files are located before you detach the database.
- Detach the database. In SQL Server Management Studio (SSMS), just right-click the database and choose Tasks > Detach… and click OK. The database will disappear from SSMS (gasp!).
- Move the transaction log file.
- Back in SSMS, right click Databases and pick Attach…, click Add, find your .mdb file and click OK.
- In the dialog on the bottom part (database details), you will see the log file has Not Found under the Message column. Fix the pathname of the log file to the new location, use the … button if you like or just type it in. The error message should disappear.
- Click OK. Your database is back.
- Check the database permissions and fix them up as needed from the documentation you created earlier.