SELECT @Count=COUNT(Id) FROM #RecordTemp SET @i=0 WHILE @i<@Count BEGIN SET @i=@i+1 SELECT @Id=Id,@CoachIcNo=CoachIcNo,@StuIcNo=StuIcNo,@BeginTime=BeginTime,@EndTime=EndTime, @ActualTime=ActualTime,@StudyMile=StudyMile,@StudyType=StudyType,@Satisfaction=Satisfaction, @SchoolNo=SchoolNo,@TerminalNo=TerminalNo,@ExeState=ExeState,@S_IcSerialNo=S_IcSerialNo, @C_IcSerialNo=C_IcSerialNo, @SchoolId=SchoolId,@StuId=StuId,@RegDate=RegDate,@CoachId=CoachId,@CarCardNo=CarCardNo, @StuTechType=StuTechType,@CarTechType=CarTechType,@CoachTechType=CoachTechType, @CoachDriveType=CoachDriveType,@CoachTeachType=CoachTeachType, @StudentIcSerialNo=StudentIcSerialNo,@CoachIcSerialNo=CoachIcSerialNo, @ExeTime=ExeTime,@StuLeftTime=StuLeftTime,@VersionNo=VersionNo FROM #RecordTemp WHERE RowId=@i