Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I rollback an UPDATE query in SQL server 2005?

Tags:

How can I rollback an UPDATE query in SQL server 2005?

I need to do this in SQL, not through code.

like image 913
Guddu Avatar asked Apr 06 '09 13:04

Guddu


1 Answers

begin transaction  // execute SQL code here  rollback transaction 

If you've already executed the query and want to roll it back, unfortunately your only real option is to restore a database backup. If you're using Full backups, then you should be able to restore the database to a specific point in time.

like image 168
Adam Robinson Avatar answered Sep 19 '22 18:09

Adam Robinson