Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 undo update query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

66 Posts

Posted - 07/26/2010 :  06:27:07  Show Profile  Reply with Quote
is it possible to undo an update statement which has updated my table .
i was not useing any transaction but i directly updated it.
now i want to recover old data and i dont have back also.


Slow But Sure Yak Herding Master

United Kingdom
3608 Posts

Posted - 07/26/2010 :  06:32:55  Show Profile  Reply with Quote
If you have a backup from before you ran the update, you can recover that, but even if you do, any changes between the last backup and your update will be lost (unless you take regular log backups).

If not, then see it as a lesson on why you should always use BEGIN TRANS before an ad-hoc update.

EDIT: oh, missed the bit where you said you didn't have a backup. Oh well, there is another lesson, always have backups. If you learn nothing else, learn how to take backups and drill it into your brain..

Edited by - RickD on 07/26/2010 06:34:28
Go to Top of Page

Aged Yak Warrior

746 Posts

Posted - 07/26/2010 :  06:34:17  Show Profile  Reply with Quote
if you have backup it can be done. If you were doing update directly on performance-live database and there is no logging/backup, there is no magical undo.
Go to Top of Page

Flowing Fount of Yak Knowledge

2937 Posts

Posted - 07/26/2010 :  06:43:28  Show Profile  Reply with Quote
What was the Update statement?If it was some easy update like replcacing "NULL values" with "some values",you can rewrite the update to set all those values to NULL again.

If it cannot be done that easily then without any BackUp you are at dead end !!!

Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000