views:

57

answers:

2

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?

+2  A: 

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.

Robin Day
+1  A: 

Your data can be recovered only in case: 1) database uses full recovery model; 2) you have full backup that you make before accidental deleting; 3) you have have NOT recover or backup again this database yet.

If this is correct, you should: 1) make transaction log backup; 2) restore database from full backup WITH NORECOVERY option; 3) restore transaction log using STOPAT option.

Alex_L
thx, this will push me in the right direction. i'll check it out.
Sem Dendoncker