Home » Blog » Reply » Reply To: SQL Server log file does not match the primary file

Reply To: SQL Server log file does not match the primary file

Stephen West ~ Modified: September 1st, 2015 ~ ~ 1 Minute Reading

Home Forums SQL Server log file does not match the primary file Reply To: SQL Server log file does not match the primary file

#545 Score: 0
Stephen West
Moderator
4 pts

1. Create a new database with same name to default database location.
2. Stop SQL server.
3. Copy old mdf file to overwrite newly created mdf file and delete new ldf file
4. Start SQL Server, database will be in emergency mode
5. Detach the emergency mode database
6. Copy original ldf file to default database location (where new LDF file as created and deleted under step 3 above.
7. Attach the database MDF file.

Hope it will work for you