//遍歷tmp_check的年份和月份DECLARE @year as varchar(4)DECLARE @month as varchar(2)DECLARE cur CURSOR FOR SELECT nf,yf FROM tmp_check;OPEN cur fetch next from cur into @year,@monthwhile(@@fetch_status=0)beginPRint(@year)print(@month)//在這做其它的事fetch next from cur into @year,@monthend close cur DEALLOCATE cur
新聞熱點
疑難解答