views:

404

answers:

3

I have used an update command to update the whole table in an Sql Server 2000 database by mistake. I was actually meaning to update just one row. Now all the 2000 rows contain the update. Is there a way to roll back this change?

+2  A: 

Unless you started your update with an explicit transaction, no.

However, you might be able to use Log Rescue . I'm not sure though if this can help you in this case.

A better option might be to restore a backup to a new database and merge the old and new tables.

Jonas Lincoln
A: 

No, not unless you have a backup to revert to.

I've done that mistake once. Now I start every manual operation with BEGIN TRAN. The worst that can happen then is that you forget to COMMIT TRAN and keep a lock on the table.

idstam
A: 

If you have audit logs available use those to get back to the old state. Otherwise you will need to revert to your latest backup at that point in time. There are some products which allow you to examine the log and take specific data from them Lumigent's Log Explorer (http://www.ssw.com.au/SSW/LogExplorer/) is one, but they tend to be on the expensive side and won't help you immediately if you don't have them already.

If you have no current backups and/or no audit tables, I would update my resume.

HLGEM
Already updated...
Daud
@Xardas: we had some serious server-killing issues with lumigent log explorer, you might try apex sql log instead
Steven A. Lowe