When a sproc is executed on one of our ASP.NET pages, it times out on the SQL Server with the exception Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
. When I execute the same sproc in SSMS, it returns relatively quickly. The SQL Server and IIS are on the same box. I logged in as the same user in both places. Other pages are just fine.
相关问题
- sql execution latency when assign to a variable
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Entity Framework 4.3.1 failing to create (/open) a
1) The default timeout for an ADO.Net command to SQL Server is 30 seconds. You can change this to a higher value (or 0 to disable timeouts) on the SqlCOmmand object. SSMS doesn't have a timeout when it runs queries.
2) But it may be that the query is timing out because something else is blocking it from running. Whilst waiting for a response from the asp.net page, are you able to run sp_who2 on the SQL Server, and check the Blk column - if there's an entry there with a value different to the SPID in the same row, some blocking is occurring.
Try increasing the
CommandTimeout
property and see if that resolves the issue:Probably Parameter Sniffing.
My answer here gives you some queries that you can use to retrieve both execution plans (the SSMS one and the ASP.NET one) to compare and contrast.
Edit
This might be a more useful query actually.