Click here to Skip to main content
15,920,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I would like to know is there any option in mssql 2008 R2 to rollback or revert to previous Data values .

For Example I have a Table named Employee and a field 'EmployeeName'.I have 200 rows of data which contains several names . I mistakenly updated all the field values 'EmployeeName = 'Abc'.So the data in whole 200 rows is now set as 'Abc' .But i need the data which was stored earlier.
I googled and was not able to find the apt method.

Thanks in Advance

Thank you
Rizwan
Posted

1 solution

Nope. No standard "oops" methods to undo mistakes - that is what Transactions are there for.
The best solution is to reload from your last backup - you do backups, don't you? - and then re-enter any changes. If you don't have a backup, then it gets horribly complicated and will depend on the logging level your DB uses - and it'll probably cost you money: Google[^]

If this is your development database then it's not going to be a problem: just recreate it. If it's your production DB though, you need to talk to your boss quickly, because you may have a major problem and he will find out. It's better if you bring it to his attention ASAP so the actual damage can be minimised.
 
Share this answer
 
Comments
MohRizwan 15-Jul-14 3:06am    
Thanks For yourt reply Mr.Griff i just thought .As it is a backup db no issues .But when i get that problem i just thought how to solve it . If it is in the case of production DB ...what is the way to recover the database.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900