当前位置: 代码迷 >> SQL >> SQLSERVER 一个简略的游标应用
  详细解决方案

SQLSERVER 一个简略的游标应用

热度:146   发布时间:2016-05-05 09:50:39.0
SQLSERVER 一个简单的游标应用
declare test_cursor cursor scroll for select id from member
open  test_cursor
declare @id int
while @@FETCH_STATUS=0
begin
print @id
update member set mobile = cast(rand()*100000000000 as bigint) where [email protected] ;
fetch next from test_cursor into @id
end
close test_cursor
deallocate test_cursor
  相关解决方案