1 --查询时间范围内的数据 2 select * from dbo.point where wtime >'2014-05-01 23:59:59' and wtime< '2014-05-02 00:40:42.000' 3 4 5 delete from point where wtime >'2014-05-01 23:59:59' and wtime< '2014-05-02 00:40:42.000' 6 7 --查询时间范围内的数据,并插入到临时表中 8 select * into a_temp from point where wtime between '2014-05-01 00:00:42.000' and '2014-05-01 00:40:42.000' 9 10 --查询临时表内的数据 11 select * from a_temp 12 13 14 --更新临时表的时间 15 update a_temp set wtime=DATEADD(day,1,wtime) 16 17 --把临时表中的数据插入到表中 18 insert into point select pointid,pointtype,pointvalue,pointunit,pointvalue2,pointunit2,wtime from a_temp