declare
cur_ai
cursor
for
select ul.id as ai_id from userlist
open cur_ai
fetch next from cur_ai into @id
while ( @@FETCH_STATUS = 0 )
begin
-- 方法体
fetch next from cur_ai into @id
end
close cur_ai
deallocate cur_ai
select ul.id as ai_id from userlist
open cur_ai
fetch next from cur_ai into @id
while ( @@FETCH_STATUS = 0 )
begin
-- 方法体
fetch next from cur_ai into @id
end
close cur_ai
deallocate cur_ai