declare @id int
declare cursor1 cursor for select COSTID from FACT_COST where ALIMONY = 2
open cursor1;
fetch next from cursor1 into @id
while @@FETCH_STATUS =0
begin
update FACT_COST set ALIMONY =cast( FLOOR(1500 + RAND() * 1001) as int)
where COSTID = @id
fetch next from cursor1 into @id
end
close cursor1;
deallocate cursor1;
只显示命令已成功 但是却没有数据
插入数据或者更新数据之后提交下事物看看,commit 一下