recover data from mdf files (ndf being missing)

前端 未结 2 520
忘了有多久
忘了有多久 2021-01-25 10:29

Our client\'s server got corrupted and the drives containing NDF and LDF files were gone. The only drive that survived was the one with MDF files.

There were no backups

2条回答
  •  隐瞒了意图╮
    2021-01-25 11:03

    You will need to restore your database by using sp_attach_single_file_db system stored procedure. Something like this...

    USE [master]
    GO
    
    EXECUTE sp_attach_single_file_db @dbname='DB_Name',
    @physname=N'C:\Path_To_Your_MDF_FILE\DB_Name.mdf'
    GO
    

    Edit

    USE [master]
    GO
    
    CREATE DATABASE DB_Name
    ON (FILENAME = N'C:\Path_To_Your_MDF_FILE\DB_Name.mdf') 
    FOR ATTACH ;
    GO
    

提交回复
热议问题