C# 从MVC web应用程序调用表值过程时超时过期异常
我已经构建了带有表值参数的sql存储过程,这些参数是传递给diq表的过滤器 从记录超过15000000条的diq表中获取数据 并将按年龄组分组的女性和男性计数保存在 另一张桌子C# 从MVC web应用程序调用表值过程时超时过期异常,c#,sql-server,asp.net-mvc,stored-procedures,C#,Sql Server,Asp.net Mvc,Stored Procedures,我已经构建了带有表值参数的sql存储过程,这些参数是传递给diq表的过滤器 从记录超过15000000条的diq表中获取数据 并将按年龄组分组的女性和男性计数保存在 另一张桌子 create proc SP_fillSmryAgeCohort ( @psc as tempProcCode readonly, @refc as tempRefCode readonly, @relc as tempRelCode readonly, @ethc as tempEthCode readonly, @
create proc SP_fillSmryAgeCohort
(
@psc as tempProcCode readonly,
@refc as tempRefCode readonly,
@relc as tempRelCode readonly,
@ethc as tempEthCode readonly,
@cntc as tempCntryCode readonly,
@fromDate datetime,
@toDate datetime
)
as
begin
SET nocount ON
declare @SQL NVARCHAR(1000)
declare @PscCount int
declare @refcCount int
declare @relcCount int
declare @ethcCount int
declare @cntcCount int
set @PscCount = (select COUNT(psc) from @psc)
set @refcCount = (select COUNT(refc) from @refc)
set @relcCount = (select COUNT(relc) from @relc)
set @ethcCount = (select COUNT(ethc) from @ethc)
set @cntcCount = (select COUNT(cntc) from @cntc)
delete from dbo.FilterSmryAgeCohort
SET @SQL = 'insert into FilterSmryAgeCohort
(cnt,sexcode,AgeCohortText) select count(distinct id)cnt,sexcode,AgeCohortText from diq
WHERE 1=1'
IF(@PscCount > 0)
BEGIN
SET @SQL = @SQL + 'AND diq.psc in (select psc from @psc )'
END
IF(@refcCount > 0)
BEGIN
SET @SQL = @SQL + 'AND diq.refc in (select refc from @refc )'
END
IF(@relcCount > 0)
BEGIN
SET @SQL = @SQL + 'AND diq.relc in (select relc from @relc )'
END
IF(@ethcCount > 0)
BEGIN
SET @SQL = @SQL + 'AND diq.ethc in (select ethc from @ethc )'
END
IF(@cntcCount > 0)
BEGIN
SET @SQL = @SQL + 'AND diq.cntc in (select cntc from @cntc )'
END
SET @SQL = @SQL + 'and diq.regdate>= @fromDate
and diq.regdate<= @toDate group by sexcode,AgeCohortText'
EXECUTE sp_executesql @SQL,
N'@psc tempProcCode READONLY , @refc tempRefCode READONLY , @relc tempRelCode READONLY ,
@ethc tempEthCode READONLY ,@cntc tempCntryCode READONLY ,@fromDate datetime ,@toDate datetime' ,
@psc, @refc , @relc , @ethc , @cntc , @fromDate , @toDate
end
go
我从我的MVC web应用程序中调用它
使用实体框架6 exrtas包
我第一次从我的应用程序调用该过程成功完成
没有错误,
但当我多次调用它时,会导致超时过期异常
错误:超时已过期。操作完成前的超时时间或服务器没有响应
我需要帮助获得有关此异常的更多信息以及原因是什么
是的,怎么解决呢
thx:可能的重复