MSSQL 游标应用

MSSQL 游标使用declare nn cursor staticfor select id from user open nnfetch next from nn into @idwhi

MSSQL 游标使用

declare nn cursor staticfor select id from user open nnfetch next from nn into @idwhile @@fetch_status = 0 begin      --处理语句fetch next from nn into @idendclose nndeallocate nn
?

?

静态游标,定义办法