把一张表的 每行数据的 一个字段的值进行随机
declare @tid intdeclare topic_cur cursor forselect tidfrom bbs_topicsopen topic_curfetch next from topic_cur into @tidwhile (@@fetch_status=0)beginUPDATE [dbo].[bbs_topics] SET iconid=CEILING(rand()*15) WHERE tid=@tidfetch next from topic_cur into @tidendclose topic_curdeallocate topic_cur