更新命令上的 SQL Server 错误 - “当前命令发生严重错误" [英] SQL Server error on update command - "A severe error occurred on the current command"

查看:67
本文介绍了更新命令上的 SQL Server 错误 - “当前命令发生严重错误"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SQL Server Management Studio 中运行以下查询会出现以下错误.

update table_name set is_active = 0 where id = 3

<块引用>

当前命令发生严重错误.结果,如果有的话,应该被丢弃.

  • 日志已被截断
  • 有一个更新触发器,但这不是问题
  • 交易计数为零 (@@trancount)

我在数据库中的其他几个表上尝试了相同的更新语句,它们工作正常.

DBCC CHECKTABLE('table_name');

给予

'table_name' 的 DBCC 结果.对象table_name"在 1 页中有 13 行.DBCC 执行完成.如果 DBCC 打印错误消息,请联系您的系统管理员.

解决方案

我刚刚遇到了同样的错误,归结为索引损坏.重新索引表修复了问题.

Running the following query in SQL Server Management Studio gives the error below.

update table_name set is_active = 0 where id  = 3

A severe error occurred on the current command. The results, if any, should be discarded.

  • The logs have been truncated
  • there is an update trigger but this isnt the issue
  • the transaction count is zero (@@trancount)

I have tried the same update statement on a couple of other tables in the database and they work fine.

DBCC CHECKTABLE('table_name');

gives

DBCC results for 'table_name'.
There are 13 rows in 1 pages for object "table_name".
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

解决方案

I just had the same error, and it was down to a corrupted index. Re-indexing the table fixed the problem.

这篇关于更新命令上的 SQL Server 错误 - “当前命令发生严重错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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