SQL Server 我需要修复“超时已过期"的错误.超时时间已过"
我知道有人问过很多次,但我似乎无法获得已阅读的修复程序来解决我的问题.我收到 SQL Server 错误,提示操作完成之前超时时间已过,或者服务器没有响应."根据 选项>设计器>覆盖连接字符串超时值"下的设置更改为 120 秒the-timeout-for-a-manually-executed-query-in-sql-server">this 发布,但是......它仍然在 30 秒后超时.我正在从 Visual Studio 访问数据库,直接使用它,而不是在客户端代码中使用 ado.我愿意接受建议......这是查询顺便说一句:
I know it's been asked a bunch of times but I can't seem to get the fixes I've read to solve my issue. I'm getting the SQL Server error that "the timeout period elapsed prior to completion of the operation or the server is not responding." I changed the setting under Tools>Options>Designers>"Override connection string time- out value" to 120 seconds as per this posting, but... it still times out after 30 seconds. I'm accessing the database from visual studio, working directly with it, and not with ado in client code. I'm open to suggestions... here's the query btw:
<代码>选择象征从tblSymbolsMain在哪里((SELECT dbo.LatestDateInDailyPricingVolBySymbol(tblSymbolsMain.Symbol) AS Expr1) < dbo.RecentTradingDateByNumber(5))
简而言之,目标是返回主代码表中的所有股票代码,这些代码表中至少有 5 个交易日没有每日定价数据点.
In a nutshell, the goal is to return all stock symbols from a main symbols table that don't have a daily pricing data point in the pricing table for at least 5 trading days.
一如既往地提前致谢..
As always thanks in advance..
推荐答案
代码似乎不正确...您有 ...WHERE (SELECT...)
什么地方?
The code doesnt appear to be correct ... you have ...WHERE (SELECT...)
WHERE what?
你确定你不是在追求
SELECT MyCols FROM MyTable WHERE ID IN (...)
或
SELECT MyCols FROM MyTable WHERE ID NOT IN (...)
其中 (...)
代表另一个返回某种 ID 的选择.
Where (...)
represents another select returning some sort of ID.
否则当然会超时.该选择可能会返回一个计数,WHERE 1
可以继续……
Otherwise of course you'd get a timeout. That select may return a count and WHERE 1
can go on and on and on...
相关文章