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 

相关文章:

  • 2021-12-09
  • 2021-09-28
  • 2021-04-01
  • 2021-10-10
  • 2021-11-16
  • 2022-01-04
  • 2021-09-03
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-02-08
  • 2021-12-04
  • 2021-12-01
相关资源
相似解决方案