在Delphi中执行存储过程超时的问题
通过下面的存储过程执行的时候,超时无法成功,我用的是Delphi中ADO的TADOStoredProc
超时时间我都设了5分钟了还是超时,在SQL 2000中测试执行时不超过1秒的
with spCreateSchedule do //spCreateSchedule是TADOStoredProc
begin
Prepared;
Parameters.ParamByName('@BeginDate').Value:=s_DateBegin;
Parameters.ParamByName('@EndDate').Value:= s_DateEnd;
Parameters.ParamByName('@employeeID').Value:= Employee;
ExecProc;
end;
但是如果用下面的方法执行存储过程速度非常快,不存在超时的问题
在SQL 2000中测试存储过程的时候速度也是非常快的,请各位高手们帮忙分析下
var
SqlStr:String;
begin
SqlStr:='execute createSchedule';
SqlStr:=SqlStr+' '+quotedStr(s_DateBegin)+','
+quotedStr(s_DateEnd)+','
+quotedStr(Employee);
DM_main.Conn.Execute(SqlStr);
end;