declare @id as int
declare @count as int
set @count = (select COUNT(*) from TmpTable where ArchiveTimes = '')
while @count > 0
begin
set @id = (select top(1)ID from TmpTable where ArchiveTimes= '' order by ID desc)
set @lastArchiveTimes = (select top(1)ArchiveTimes from TmpTable where ID > @id order by ID asc)
update TmpTable set ArchiveTimes=CONVERT(varchar(20),dateadd(n,-5,@lastArchiveTimes),20) where ID = @id
set @count = @count - 1
end