欢迎来到【一个大西瓜】的博客

不曾为梦想奋斗,拿什么去燃烧青春。有梦之人亦终将老去,但少年心气如昨。
太阳每一个时刻都同时是夕阳和朝阳,每天她沉入西边,意味着她同时从另一面土地升起。
扩大
缩小

记一次查询超时的解决方案The timeout period elapsed......

问题描述

在数据库中执行查询语句,大约1秒钟查询出来,在C#中用ado进行连接查询,一直等待很久未查出结果,最后抛出查询超时异常。

异常内容如下:

Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

解决方案:

exec sp_updatestats

执行结果:

参考文章:

https://stackoverflow.com/questions/8602395/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation

https://docs.microsoft.com/zh-cn/sql/t-sql/statements/update-statistics-transact-sql?view=sql-server-2017

posted on 2018-07-06 17:06  一个大西瓜咚咚咚  阅读(28244)  评论(2编辑  收藏  举报

导航