我在执行sql查询时遇到了一个问题,我不知道该怎么办。尝试了很多东西和很多创造性的谷歌搜索。
我有一个连接(ADO.NET)到SQLServer14的网站(我们从一切正常的版本10切换过来)。从网站执行搜索,当搜索结果仅返回一行时,一切正常。当搜索结果返回多于一行时,我从SQL server获得一个超时。
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the
server is not responding.
SQL查询完全相同。只有参数改变。
在SQL Management studio中,所有SQL查询都可以正常工作。
我所尝试的:
1. Checked the execution plan and its identical for both searches.
2. Changed server memory allocation.
3. sp_refresview.
4. SQL Profiler gives no warnings or raised eyebrows.
5. sp_who2 shows no blocking.
6. Changed Remote Query Timeout to 0 (no timeout).
7. Increased timeout in web.config to 120 seconds.
8. set arithabort = on.
9. set nocount = on.
我很困惑。。。
编辑
据我所见,SQL探查器告诉我SQL事务完成时没有任何问题。但由于某些原因,结果永远不会到达web服务器。这种情况只发生在特定的SQL查询中,因此在大多数情况下,与SQL服务器和web服务器之间的通信都是正常的。
另外,当我从VisualStudio在本地运行该网站时,一切都会完美运行!没有超时或任何事情。我只在web服务器上执行SQL查询XYZ。