SQL Server简单的Insert语句超时 [英] SQL Server simple Insert statement times out
问题描述
我有一个有6列的简单表。大多数时候任何insert语句到它的工作正常,但有一段时间,我得到一个DB超时异常:
超时过期。操作完成之前超时时间或服务器未响应。该语句已终止。
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秒。
我应该提及使用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分析器中看起来都正常,表没有索引,但是PK(Page)丰满度: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连接返回大结果集,这些查询暂停一段时间的WaitType ASYNC_NETWORK_IO。在此期间,所有其他查询超时,因此特定插入与它无关。
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简单的Insert语句超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!