--声明游标
declare user_cursor1 cursor
for select codeid from gl_user where codename like '%小%'
--打开游标
open user_cursor1
--定义参量
declare @uid varchar(40)
--取值
fetch next from user_cursor1
into @uid
--循环
while(@@fetch_status=0)
begin
--显示
print @uid
--游标指向下一条记录
fetch next from user_cursor1 into @uid
end
--关闭游标
close user_cursor1
--释放
deallocate user_cursor1
declare user_cursor1 cursor
for select codeid from gl_user where codename like '%小%'
--打开游标
open user_cursor1
--定义参量
declare @uid varchar(40)
--取值
fetch next from user_cursor1
into @uid
--循环
while(@@fetch_status=0)
begin
--显示
print @uid
--游标指向下一条记录
fetch next from user_cursor1 into @uid
end
--关闭游标
close user_cursor1
--释放
deallocate user_cursor1
浙公网安备 33010602011771号