C#技术百科
问问你的心你有没有信心 做事情要专一坚定,执着

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  王德田  阅读(183)  评论(0编辑  收藏  举报