如何撤消 SQL Server UPDATE 查询? [英] How to undo a SQL Server UPDATE query?

查看:192
本文介绍了如何撤消 SQL Server UPDATE 查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SQL Server Management Studio 中,我做了以下查询.
不幸的是,我忘记取消注释 WHERE 子句.
更新了 1647 行而不是 4 行.

In SQL Server Management Studio, I did the query below.
Unfortunately, I forgot to uncomment the WHERE clause.
1647 rows were updated instead of 4.

如何撤消最后一条语句?

How can I undo the last statement?

不幸的是,我刚刚翻译完那 1647 行,正在做最后的更正,因此没有备份.

Unfortunately, I've only just finished translating those 1647 rows and was doing final corrections , and thus don't have a backup.

UPDATE [dbo].[T_Language]
   SET 
       [LANG_DE] = 'Mietvertrag' --<LANG_DE, varchar(255),>
      ,[LANG_FR] = 'Contrat de bail' -- <LANG_FR, varchar(255),>
      ,[LANG_IT] = 'Contratto di locazione' -- <LANG_IT, varchar(255),>      
      ,[LANG_EN] = 'Tenancy agreement' -- <LANG_EN, varchar(255),>
       --WHERE [LANG_DE] like 'Mietvertrag'

有一个交易协议,至少我希望如此.

There is a transaction protocol, at least I hope so.

推荐答案

未提交的事务可以通过发出命令 ROLLBACK

A non-committed transaction can be reverted by issuing the command ROLLBACK

但是如果您在自动提交模式下运行,则您无能为力....

But if you are running in auto-commit mode there is nothing you can do....

这篇关于如何撤消 SQL Server UPDATE 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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