在result表中查询到还没有执行的resultId的数据,将resultId插入临时表tt$;
循环临时表,执行存储过程,参数为resultId,执行完之后将临时表的已执行resultId删除;
select resultId into tt$ from Result where paperId=464 and isQced='Y' and resultId not in(select resultId from NonExperienceScoreDtl_HW) order by resultId asc
select * from tt$
declare @resultid int=0,@oldresultid int=0
select top 1 @resultid=resultId from tt$ order by resultId asc
while @resultid is not null
begin
exec dbo.UP_HW_hardcore @resultid
exec dbo.UP_HW_Protopass @resultid
exec dbo.UP_HW_NonExperienceScore @resultid
set @resultid = (
select top 1 resultId from tt$ where resultId>@resultid order by resultId asc
)
end