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
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 How to use Rollback statement in SQL server.

Author  Topic 

pearlkin
Starting Member

3 Posts

Posted - 2011-05-26 : 04:03:41
How to use Rollback statement in SQL server.

Issue: I have update a table but i want to revert it back to old values. can any one tell me step by step what i have to do.

Thanks in advance.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-05-26 : 04:30:15
Create a transaction (begin tran) then whenever you want to rol back any updates made in that transaction issue a rollback tran statement.
When you want to commit the work issue a commit tran statement.

I suspect this isn't what your question is about though.
You are probably looking at restoreing backups to another database and copying the table.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -