阿里云折扣码

轻云博客 > SQL Server数据库设计 > sql server 游标fetch简单用法

sql server 游标fetch简单用法

作者:Aisencici / 日期:2014-5-8 22:40:00 / 分类:SQL Server数据库设计 / 浏览:3306

sql server 游标fetch简单用法


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,@month
while(@@fetch_status=0)
begin
print(@year)
print(@month)
fetch next from cur into @nf
end
close cur
DEALLOCATE cur


本文标签:
From:
分享到: