SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 How to use Rollback statement in SQL server.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pearlkin
Starting Member

India
3 Posts

Posted - 05/26/2011 :  04:03:41  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 05/26/2011 :  04:30:15  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000