6

My client has accidentally deleted all the records of a table from a test database. This test database is in SQL Server 2005 Express and we don't have a backup.

Is it possible to restore the deleted rows from the transaction log (.ldf) file? If yes, how?

12
  • SQL server point in time restore could come to your rescue here, see msdn.microsoft.com/en-us/library/ms190982(v=sql.90).aspx
    – hermiod
    Commented Oct 22, 2011 at 10:29
  • Is Point-In-Time restore enabled by default even in SQL Server 2005 Express Edition?
    – RPK
    Commented Oct 22, 2011 at 10:42
  • 2
    possible duplicate of get back deleted record Commented Oct 22, 2011 at 10:50
  • @MartinSmith Recover Model is set to 'Simple' by default.
    – RPK
    Commented Oct 22, 2011 at 11:03
  • 1
    The 3rd comment against the initial post is where RPK first mentions being in simple recovery mode. This comment was posted 30 minutes after my answer. The initial post only mentions absence of a backup, which is not an issue with PiT restore if you are in a recovery mode other than Simple. In short, at the time I posted my answer, the currently available information did not exclude point-in-time restore therefore it was a valid answer.
    – hermiod
    Commented Oct 24, 2011 at 19:11

2 Answers 2

9

If your database is in full recovery mode you can also try third party tools such as ApexSQL Log or SQL Log Rescue.

These tools will attempt to read your transaction log and reconstruct statements.

You can also try reading transaction log manually using fn_dblog function but it’s going to be complex since this is not a well-documented function.

1
  • I just read through all the comments and saw that you are in a simple recovery mode. In that case chances for recovery are really minimal Commented Jun 6, 2013 at 11:32
8

No. There is no way to recover the data.

The LDF is most likely useless even with a 3rd party log reader tool.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.