如何将更新的数据库字段还原为mssql 2008R2中的旧数据值 [英] How to revert a updated databse field to the old data values in mssql 2008R2

查看:62
本文介绍了如何将更新的数据库字段还原为mssql 2008R2中的旧数据值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我想知道mssql 2008 R2中是否有任何选项可以回滚或恢复到以前的数据值。



例如,我有一个名为Employee的表和一个字段'EmployeeName'。我有200行数据,其中包含多个名称。我错误地更新了所有字段值'EmployeeName ='Abc'。所以整行200行的数据现在设置为'Abc'。但是我需要先前存储的数据。

我google了无法找到合适的方法。



预付款谢谢



谢谢

Rizwan

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

推荐答案

不。没有标准的oops方法来消除错误 - 这就是交易的用途。

最好的解决方案是从上次备份重新加载 - 你做备份,不是吗? - 然后重新输入任何更改。如果你没有备份,那么它会变得非常复杂,并且将取决于你的数据库使用的日志记录级别 - 而且它可能会花费你的钱: Google [ ^ ]



如果这是您的开发数据库,​​那么它不会成为问题:只需重新创建它。如果它是你的生产数据库,你需要快速与你的老板交谈,因为你可能有一个重大问题,他会发现。如果你尽快引起他的注意,那么最好将实际的伤害降到最低。
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.


这篇关于如何将更新的数据库字段还原为mssql 2008R2中的旧数据值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆