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

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 simple rollback

Author  Topic 

benams
Starting Member

1 Post

Posted - 2010-03-01 : 04:14:56
I used an update sql statement to change a table of sqlserver 2005 and I want to bring it back to its former state. can I rollback the table somehow?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-03-01 : 05:43:38
If you have started your update with a
begin transaction

then you can do
rollback if you want otherwise you have to do
commit to release the changes and stop blocking the table.

But I don't think you have started a transaction so your only chance is to have a backup.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-03-01 : 06:28:40
Restore the last backup alongside the current database and use update to copy the old values over. There's no undo once a transaction has committed. That happens automatically if you're not using explicit transactions (BEGIN TRANSACTION)

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -