MSSQL 游标使用
程序员文章站
2024-02-10 14:00:34
...
declare nn cursor static
for select id from user
open nn
fetch next from nn into @id
while @@fetch_status = 0
begin
--处理语句
fetch next from nn into @id
end
close nn
deallocate nn
静态游标,定义办法