DECLARE @ris_area_code char(8),@area_code varchar(5),@area_name as nvarchar(10) DECLARE mycursor CURSOR FOR select ris_area_code,area_code,area_name from new_ris_area Where area_code <>'' open mycursor FETCH NEXT FROM mycursor INTO @ris_area_code,@area_code,@area_name WHILE @@FETCH_STATUS = 0 begin Update StateZip Set village_prefix=@ris_area_code ,StateZip_name=@area_name Where StateZip_Id=@area_code FETCH NEXT FROM mycursor INTO @ris_area_code,@area_code,@area_name end CLOSE mycursor DEALLOCATE mycursor
沒有留言:
張貼留言