Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL UPDATE Query

1 view
Skip to first unread message

Marc Noon

unread,
Mar 31, 2010, 2:26:04 PM3/31/10
to
Is there a simple and effective way to revert an update query after the fact?
--
-M Noon

Hugo Kornelis

unread,
Apr 7, 2010, 5:11:23 PM4/7/10
to
On Wed, 31 Mar 2010 11:26:04 -0700, Marc Noon wrote:

>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

0 new messages