Search code examples
sql-serverbackuprecoverylogfiles

SQL Server LOG Data recovery


I was wondering how you can recover data from your logfile. I'm using sql 2005 (full backup).

The problem is that a service cleared my data last night (which it shouldn't have). and now I want to recover those rows that were deleted before.

can anyone tell me how I can do this?


Solution

  • As long as you have a backup of your database from before the delete and then all transaction log backups that have been made since the last database backup then you will be able to restore to a point in time.

    The first thing to do is take a backup of the transaction log.

    Then you restore your last database backup and all transaction log backups since then up to the point in time just before the delete.

    See this MSDN Article on how to do it.

    I would suggest that you leave your existing database in place as it is and restore the backups to a new database. Then you can write some scripts to transfer the required data back into your live database.