如何在 SQL Server 2005 中回滚 UPDATE 查询? [英] How can I rollback an UPDATE query in SQL server 2005?
本文介绍了如何在 SQL Server 2005 中回滚 UPDATE 查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 SQL Server 2005 中回滚 UPDATE 查询?
How can I rollback an UPDATE query in SQL server 2005?
我需要在 SQL 中执行此操作,而不是通过代码.
I need to do this in SQL, not through code.
推荐答案
begin transaction
// execute SQL code here
rollback transaction
如果您已经执行了查询并想要回滚它,不幸的是,您唯一真正的选择是恢复数据库备份.如果您使用完整备份,那么您应该能够将数据库恢复到特定时间点.
If you've already executed the query and want to roll it back, unfortunately your only real option is to restore a database backup. If you're using Full backups, then you should be able to restore the database to a specific point in time.
这篇关于如何在 SQL Server 2005 中回滚 UPDATE 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文