一个SQL Server存储过程循环的例子
declare ID_cursor cursor for
select * from 表名
open ID_cursor
/*while @@fetch_status=0*/
begin
update 表名 set 字段名='值'
end
close ID_cursor
deallocate ID_cursor
select * from 表名
open ID_cursor
/*while @@fetch_status=0*/
begin
update 表名 set 字段名='值'
end
close ID_cursor
deallocate ID_cursor
浙公网安备 33010602011771号