您的位置:首页 > 数据库

sql server 2005 游标使用小例

2009-06-13 08:46 351 查看
declare @IP varchar(50),@Email varchar(50)
declare tc cursor for select HostIP,UserEmail from RestartLog
open tc
fetch next from tc into @IP , @Email
while @@fetch_status = 0
begin
print @IP+' '+@Email
fetch next from tc into @IP , @Email
end
close tc
deallocate tc //删除对游标变量的引用
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: