SQL Server simple Insert statement times out(SQL Server 简单插入语句超时)
问题描述
我有一个有 6 列的简单表格.大多数情况下,对它的任何插入语句都可以正常工作,但偶尔我会收到 DB Timeout 异常:超时已过.操作完成之前超时时间已过或服务器没有响应.声明已终止.
I have a simple table with 6 columns. Most of the time any insert statements to it works just fine, but once in a while I'm getting a DB Timeout exception: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated.
超时设置为 10 秒.
Timeout is set to 10 seconds.
我应该提到我正在使用 NHibernate 并且该语句在插入本身之后还包含一个select SCOPE_IDENTITY()".
I should mention that I'm using NHibernate and that the statement also include a "select SCOPE_IDENTITY()" right after the insert itself.
我的想法是该表被锁定或其他原因,但当时该表上没有其他语句在运行.
My thought was that the table was locked or something, but there were no other statements running on that table at that time.
所有的插入都很简单,在sql profiler中一切正常,表没有索引,只有PK(页面完整度:98.57 %).
All the inserts are very simple, everything looks normal in sql profiler, the table has no indices but the PK (Page fullness: 98.57 %).
关于我应该寻找什么的任何想法?
Any ideas on what should I look for?
谢谢.
推荐答案
我们的 QA 有一些 Excel 连接返回了大结果集,这些查询在一段时间内被 ASYNC_NETWORK_IO 的 WaitType 暂停.在此期间,所有其他查询均超时,因此与特定插入无关.
Our QA had some Excel connections that returned big result sets, those queries got suspended with WaitType of ASYNC_NETWORK_IO for some time. During this time all other queries timed out, so that specific insert had nothing to do with it.
这篇关于SQL Server 简单插入语句超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL Server 简单插入语句超时
基础教程推荐
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 在多列上分布任意行 2021-01-01
