declare @A datetime
declare @ID varchar(12)
declare mycursor cursor for select pubdate,title_ID from titles
open mycursor
fetch next from mycursor into @A,@ID
while(@@fetch_status=0)
begin
update titles set pubdate=dateadd(day,round(rand()*120,0),@A) where title_ID=@ID
fetch next from mycursor into @A ,@ID
end
close mycursor
deallocate mycursor
posted on 2009-07-13 14:44
sanmao 阅读(91)
评论(0) 编辑 收藏