24

I accidentaly ran a DELETE command against a table with a wrong WHERE clause.

I am using SQL Server 2005.

Is there a way that could help me recover the lost data?

LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
Amr Badawy
  • 7,453
  • 12
  • 49
  • 84
  • Unless you have a backup - which you can restore - think you might be in trouble!! – Jagmag Aug 22 '10 at 08:32
  • Thank you. I needed that. I'm not alone. (Hope someone comes up with a way you can recover, though.) – slashmais Aug 22 '10 at 08:33
  • 2
    I think there are definitely 3rd party tools around - http://apex-sql-log.apex-sql-llc.qarchive.org/ or Red Gate's SQL Log Rescue http://www.red-gate.com/products/SQL_Log_Rescue/ might work - but these are all commercial paid products – Jagmag Aug 22 '10 at 08:40
  • I made the same mistake... :( – grv_9098 Sep 22 '13 at 06:45
  • The correct link for ApexSQL Log is http://www.apexsql.com/sql_tools_log.aspx – Milena Petrovic Mar 21 '14 at 20:45
  • 2
    You can find the complete step by step instruction how to recover deleted rows from SQL server table in this article https://sqlbak.com/blog/recover-deleted-data-in-sql-server/ –  Sep 07 '16 at 10:45

4 Answers4

10

It is possible using Apex Recovery Tool,i have successfully recovered my table rows which i accidentally deleted

if you download the trial version it will recover only 10th row

check here http://www.apexsql.com/sql_tools_log.aspx

Alok Sahoo
  • 135
  • 1
  • 10
8

You have Full data + Transaction log backups, right? You can restore to another Database from backups and then sync the deleted rows back. Lots of work though...

(Have you looked at Redgate's SQL Log Rescue? Update: it's SQL Server 2000 only)

There is Log Explorer

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541
5

I think thats impossible, sorry.

Thats why whenever running a delete or update you should always use BEGIN TRANSACTION, then COMMIT if successful or ROLLBACK if not.

Ash Burlaczenko
  • 24,778
  • 15
  • 68
  • 99
3

What is gone is gone. The only protection I know of is regular backup.

spbfox
  • 939
  • 4
  • 8