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?

  • 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 Oct 22 '11 at 10:29
  • Is Point-In-Time restore enabled by default even in SQL Server 2005 Express Edition? – RPK Oct 22 '11 at 10:42
  • 2
    possible duplicate of get back deleted record – Mark Storey-Smith Oct 22 '11 at 10:50
  • @MartinSmith Recover Model is set to 'Simple' by default. – RPK Oct 22 '11 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 Oct 24 '11 at 19:11
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.

  • 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 – Gunter Wesley Jun 6 '13 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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