Results 1 to 4 of 4

Thread: Is there a method to recover corrupted .ldf file?

  1. #1
    Join Date
    Mar 2015

    Is there a method to recover corrupted .ldf file?

    hello folks,

    I have a mdf file and ldf file from a hard drive that was corrupted... it appears that corruption caused problems with the ldf file. During an attach command SQL Server I get the following error: "Error 823: I/O error 38(reached the end of the file.) ..... on the LOG.ldf file"

    Guys, any help, I'll be appreciated!

  2. #2
    Join Date
    Sep 2002
    Tried attach .mdf file only with sp_attach_single_file_db?

  3. #3
    Join Date
    Mar 2015
    Restore With Transact-SQL

    -Click “New Query” in the Management Studio’s main toolbar. This opens a large text area on the right side of the screen.

    -Click in the text area and type a Create Database statement using the following Transact-SQL code as a guide:
    CREATE DATABASE MyDatabase ON (FILENAME = 'c:\data files\my_data.mdf'), (FILENAME = ' c:\data files\my_data.ldf') FOR ATTACH;

    -Click the “Execute” button in the Transact-SQL toolbar, located just under the Management Studio’s main toolbar. The Execute button symbol is a right-pointing triangle. SQL Server Management Studio restores the database.

    Helpful resources to explain another methods of restoration and gave more variants of sql data recovery... SQL Server Repair Toolbox

  4. #4
    Join Date
    May 2015
    Run Chkdsk to find the issue with system inconsistency. You can attach .MDF file without transaction log file (.ldf).
    You can consider below article for details:


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts