How to recover database from MDF in SQL Server 2005?

后端 未结 9 525
野性不改
野性不改 2021-01-31 11:20

I have an MDF file and no LDF files for a database created in MS SQL Server 2005. When I try to attach the MDF file to a different SQL Server, I get the following error messa

9条回答
  •  甜味超标
    2021-01-31 12:19

    Found a another way that works completely:

    1. Create 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.

    I got a working database after trying all of the above that failed for me.

提交回复
热议问题