在SQL Server中撤消查询
我错误地在SQL Server的表上插入了插入
查询,然后插入了100行。我想撤消它,但我没有回滚。
I ran an insert
query on a table in SQL Server by mistake and 100 rows got inserted. I want to undo it but I do not have rollback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能删除,但是在将来,您需要在交易中包围查询或手动设置此类行为。
默认情况下,SSMS确实自动使用。更改此行为使用此操作:
将Intrant_transactions设置为
更多信息:
https://learn.microsoft.com/en-us/sql/sql/t-sql/sql/statements/set-implitic-implitic-transactions-transactions-transactions-transact-transact-sql?view=sql -Server-ver15
You can only delete, but for future you would need to surround your query in transaction or set such behavior manually.
By default SSMS does auto-commit. To alter this behavior use this:
SET IMPLICIT_TRANSACTIONS OFF
more here:
https://learn.microsoft.com/en-us/sql/t-sql/statements/set-implicit-transactions-transact-sql?view=sql-server-ver15