dbTalk Databases Forums  

SQL UPDATE Query

microsoft.public.sqlserver.mseq microsoft.public.sqlserver.mseq


Discuss SQL UPDATE Query in the microsoft.public.sqlserver.mseq forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marc Noon
 
Posts: n/a

Default SQL UPDATE Query - 03-31-2010 , 01:26 PM






Is there a simple and effective way to revert an update query after the fact?
--
-M Noon

Reply With Quote
  #2  
Old   
Hugo Kornelis
 
Posts: n/a

Default Re: SQL UPDATE Query - 04-07-2010 , 04:11 PM






On Wed, 31 Mar 2010 11:26:04 -0700, Marc Noon wrote:

Quote:
Is there a simple and effective way to revert an update query after the fact?
If you started a transaction before the UPDATE, you can issue a ROLLBACK
TRANSACTION statement. If the transaction was started longer ago, this
will undo all work done in the transaction.

If you were already in a transaction but took a savepoint just before
the UPDATE, you can use ROLLBACK plus the savepoint name to undo just
the update and keep the rest of the transaction.

If you had no transaction or if it's already committed, restoring from
backup is your only hope.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.