gpt4 book ai didi

SQL 超时过期

转载 作者:搜寻专家 更新时间:2023-10-30 20:06:22 24 4
gpt4 key购买 nike

这个 SQL 只用了 47 秒。

SELECT  B.HESAP_NO, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2 AS 'TEKLIF',B.MUS_K_ISIM,
dbo.fngcodeme(B.HESAP_NO, B.DOVIZ_KOD, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2,'20110201', '20110228') AS 'YATAN',
(CASE WHEN B.DOVIZ_KOD = 21 THEN 'EUR' WHEN B.DOVIZ_KOD = 2 THEN 'USD' WHEN B.DOVIZ_KOD = 1 THEN 'TL' END) AS 'KUR',
D.AVUKAT,
(CASE WHEN D.HESAP IN (SELECT T_HESAP_NO FROM TAKIP) THEN
(SELECT CONVERT(VARCHAR(10),ICRA_TAR,103) FROM TAKIP WHERE T_HESAP_NO = D.HESAP)
ELSE ' ' END) AS 'ICRA TARİHİ',
(CASE WHEN D.HESAP IN (SELECT T_HESAP_NO FROM TAKIP) THEN
(SELECT CONVERT(VARCHAR(10),HACIZ_TAR,103) FROM TAKIP WHERE T_HESAP_NO = D.HESAP)
ELSE '' END) AS 'HACİZ TARİHİ'
FROM YAZ..MARDATA.S_TEKLIF B, AVUKAT D
WHERE B.HESAP_NO = D.HESAP
AND B.KAPANIS_TAR IS NULL
AND ISNULL(dbo.fngcodeme(B.HESAP_NO, B.DOVIZ_KOD, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2,'20110201', '20110228'),0) > 0
GROUP BY B.HESAP_NO, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2,B.DOVIZ_KOD ,B.MUS_K_ISIM, D.AVUKAT, D.HESAP

我的超时是Connect Timeout=20000

但我仍然收到此错误。

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

Line 160: myConnection.Open();
Line 161:
Line 162: SqlDataReader dr = myCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
Line 163:
Line 164: // show the data

我哪里做错了?

最佳答案

您必须增加 myCommand 对象中的超时时间:

myCommand.CommandTimeout = 60000; // 1 minute, put 0 for infinite

关于SQL 超时过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5336240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com