How to recover deleted rows from SQL server table?
Asked Answered
P

4

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?

Paestum answered 22/8, 2010 at 8:28 Comment(6)
Unless you have a backup - which you can restore - think you might be in trouble!!Theomachy
Thank you. I needed that. I'm not alone. (Hope someone comes up with a way you can recover, though.)Fossa
I think there are definitely 3rd party tools around - apex-sql-log.apex-sql-llc.qarchive.org or Red Gate's SQL Log Rescue red-gate.com/products/SQL_Log_Rescue might work - but these are all commercial paid productsTheomachy
I made the same mistake... :(Tourist
The correct link for ApexSQL Log is apexsql.com/sql_tools_log.aspxLarrup
You can find the complete step by step instruction how to recover deleted rows from SQL server table in this article sqlbak.com/blog/recover-deleted-data-in-sql-serverInculcate
V
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

Vladi answered 26/9, 2013 at 13:25 Comment(1)
I was able to recover my deleted rows, even on a database with simple recovery model.Edd
C
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

Cowbind answered 22/8, 2010 at 8:41 Comment(0)
F
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.

Folliculin answered 22/8, 2010 at 8:44 Comment(0)
O
3

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

Okinawa answered 22/8, 2010 at 8:31 Comment(1)
That's perhaps not entirely accurate, but it is a useful general guideline to be taken into consideration before running a DELETE command.Vachil

© 2022 - 2024 — McMap. All rights reserved.