Sql Server 2000中的回滚和更新命令
我错误地使用更新命令更新了 Sql Server 2000 数据库中的整个表。 我实际上只想更新一行。 现在所有 2000 行都包含更新。 有没有办法回滚此更改?
I have used an update command to update the whole table in an Sql Server 2000 database by mistake. I was actually meaning to update just one row. Now all the 2000 rows contain the update. Is there a way to roll back this change?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
除非您通过显式事务开始更新,否则不会。
但是,您也许可以使用 日志救援 。 但我不确定这在这种情况下是否可以帮助你。
更好的选择可能是将备份恢复到新数据库并合并新旧表。
Unless you started your update with an explicit transaction, no.
However, you might be able to use Log Rescue . I'm not sure though if this can help you in this case.
A better option might be to restore a backup to a new database and merge the old and new tables.
不,除非您有备份可以恢复。
我曾经犯过一次这样的错误。 现在我用 BEGIN TRAN 开始每个手动操作。
最糟糕的情况是您忘记 COMMIT TRAN 并保持对表的锁定。
No, not unless you have a backup to revert to.
I've done that mistake once. Now I start every manual operation with BEGIN TRAN.
The worst that can happen then is that you forget to COMMIT TRAN and keep a lock on the table.
如果您有可用的审核日志,请使用它们恢复到旧状态。 否则,您将需要恢复到当时的最新备份。 有一些产品允许您检查日志并从中获取特定数据 Lumigent 的 Log Explorer ( http://www.ssw.com.au/SSW/LogExplorer/)就是其中之一,但它们往往价格昂贵,而且如果您还没有它们,也不会立即为您提供帮助。
如果您没有当前的备份和/或没有审核表,我会更新我的简历。
If you have audit logs available use those to get back to the old state. Otherwise you will need to revert to your latest backup at that point in time. There are some products which allow you to examine the log and take specific data from them Lumigent's Log Explorer (http://www.ssw.com.au/SSW/LogExplorer/) is one, but they tend to be on the expensive side and won't help you immediately if you don't have them already.
If you have no current backups and/or no audit tables, I would update my resume.