A server error occured on the current command. The results, if any, should be discarded.
来源:互联网 发布:数据交换标准 编辑:程序博客网 时间:2024/06/05 00:53
A server error occured on the current command. The results, if any, should be discarded.
近日公司有一个项目,该项目在C#调用SQL Server中的存储过程的时候发生了异常,奇怪的是该项目一直运行稳定,并且该异常只发生在特定的情况下。
Review了一下日志,重建了发生异常的现场,Debug了一下,错误信息是:
A server error occured on the current command. The results, if any, should be discarded.
直接在查询分析器Debug存储过程,几经周折,发现错误居然发生在下面这条语句中
INSERT INTO tbl(str, ...
错误信息是:
当前命令发生了严重错误。应放弃任何可能产生的结果。
注:搞笑的是只能特定的字符串INSERT到str字段中才会出异常,删掉几个字符再插入一下就没问题了
尝试了若干种办法,最后发现是由str上的索引导致的,执行下列语句后,问题成功解决:
DROP INDEX tbl.index_str;
CREATE NONCLUSTERED INDEX index_str ON tbl
(
str ASC
);
后来发现执行下述语句可以缓解这个问题
网上检索了一下,还有其他人也遇到了这个问题:
微软的原始说明:http://support.microsoft.com/kb/827366/en-us
这个也很经典,虽然不是同一个问题:http://blog.csdn.net/ghlfllz/article/details/8082982
- A server error occured on the current command. The results, if any, should be discarded.
- Error: mysql error: mysql: [Warning] Using a password on the command line interface can be insecure
- The selection cannot be run on any server
- the selection cannot be run on any server解决办法
- The selection cannot be run on any server解决办法
- the selection cannot be run on any server
- the selection cannot be run on any server 原因
- Warning: Using a password on the command line interface can be insecure .ERROR 1045 (28000): Access
- You should re-bind this JavaScript event on this element if the element be dynamically updated
- An application error occurred on the server. The current custom error settings for this application
- The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rw-rw-rw-
- This can be the result of a merge and the unknown UUID is being discarded.
- The select cannot be run on any server 报错问题
- 关于The connection to adb is down,and a server error has occured
- Restore-SPSite : cannot be restored to a server running the current version
- cmd命令行下 Warning: Using a password on the command line interface can be insecure.
- MySQL5.6 Using a password on the command line interface can be insecure解决方法;
- Warning: Using a password on the command line interface can be insecure.
- Apache Rewrite 规则详解
- Error: (vsim-3053) D:/adder/adder_controltb.v(60): Illegal output or inout port connection (port 'P0
- 通过Apache的URL地址重写(附伪静态方式)
- C++为什么不提倡使用scanf和printf函数
- 调查称66万人民币可购房移居德国是误导-移居-移民-德国
- A server error occured on the current command. The results, if any, should be discarded.
- HDFS DatanodeProtocol——sendHeartbeat
- java异常中Exception捕获不到的异常
- 关于cxGrid的使用
- 《TCP/IP详解-协议》(6)ICMP协议
- 求N+1 个数字中缺少的那个数值
- Codeforces Round #144 (Div. 2) (模拟问题)
- HTTP协议
- 海关将扣押与我国主张不一致境外地图-海关-问题地图