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
 General SQL Server Forums
 New to SQL Server Programming
 Undo the last run query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

10 Posts

Posted - 04/02/2012 :  07:38:22  Show Profile  Reply with Quote

I ran one update query without specifying where clause..The update query is not inside Transaction. Is there any way to roll back this update statement ?

Please let me know.


Flowing Fount of Yak Knowledge

5155 Posts

Posted - 04/02/2012 :  08:52:18  Show Profile  Reply with Quote
Ouch! None that I know of, Akki.

The only option that I know of is to restore your latest backup (to another location), get the data as it existed before the update, and then carefully recover the data you need.

Often times, when I have to make critical changes on a production server, I do the following:

-- 1
UPDATE SEcurities SET MarketPrice = 598.55 WHERE TICKER = 'AAPL';

-- 2

-- 3
I would run step 1, take a quick look to make sure it updated only one row, and then run step 3 if all seems well. Even this is dangerous on a production server, because you may be locking up a page, or more or locking up some hot rows etc.

Edited by - sunitabeck on 04/02/2012 08:53:20
Go to Top of Page

Starting Member

10 Posts

Posted - 04/02/2012 :  09:59:40  Show Profile  Reply with Quote
Thanks sunitha.
Go to Top of Page

Not Just a Number

15586 Posts

Posted - 04/02/2012 :  10:17:43  Show Profile  Reply with Quote
Do you have a backup before the UPDATE?

If yes, you can restore the backup to a different database name, the copy the data over


Maybe you can use lumigent log explorer



Hint: Want your questions answered fast? Follow the direction in this link

Want to help yourself?

Go to Top of Page

Patron Saint of Lost Yaks

30421 Posts

Posted - 04/02/2012 :  12:35:21  Show Profile  Visit SwePeso's Homepage  Reply with Quote
There are some log reader tools available, with which you may be able to "undo" the update.

N 56°04'39.26"
E 12°55'05.63"
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.04 seconds. Powered By: Snitz Forums 2000