我写的都有这个问题... 语法哪有问题吧, 这个是最少的, 也报这个问题BEGIN declare @agtentid int, @i int select tempid=identity(int,1,1),buyid into # from web_rebuy where datediff(dd,date,getdate())=1 order by date desc select @i=count(tempid) from # while(@i>0) begin select @agtentid=buyid from # where tempid=@i exec BuyBackCompute @agtentid set @i=@i-1 end drop table # END
declare @agtentid int,
@i int
select tempid=identity(int,1,1),buyid into # from web_rebuy where datediff(dd,date,getdate())=1 order by date desc
select @i=count(tempid) from #
while(@i>0)
begin
select @agtentid=buyid from # where tempid=@i
exec BuyBackCompute @agtentid
set @i=@i-1
end
drop table #
END