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