declare @i intset @i = 0while @i < 100beginupdate table set column = @i where ID_column = @iset @i = @i + 1end也可以用游标,当然做游标的表(或查询) 不能过于复杂,如果很复杂 可以先将查询结果存入临时表,在用临时表上游标