SQL 2005 Database will not attach after moving Log file
Posted on 2012-09-22
I recently had a problem with our SQL 2005 Database eating up all disk space with log files. I detached one of the problem databases and copied the log to a new location and deleted the old log. When I go to attach the database back again it tells me that it cannot find the log so I point it to the correct location and continued but received an error.
An error occurred while processing the log for database '<databasename>'. If possible, restore from backup. If backup is not available, it might be necessary to rebuild the log. Could not open new database '<databasename>'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error:9004)
What can I do to make this work? I have a database backup but if I do a restore I am going to run into the same problem as when I first detached the database and moved the log. What do i need to do to correct this problem?