在每个需要导出的表中加timestamp类型的字段,insert into backupTable
select * from S_table where timestampCOL not in (select SavetimestampValueCOL from backupTable)
select * from S_table where timestampCOL not in (select SavetimestampValueCOL from backupTable)
调试欢乐多
这种方法不对,backup表不需要timestamp,有也白搭。
最好是另建一个表,存的是timestamp字段的值如:
declare @最大值select @最大值 = 保存的最大值 from 新建表 --得到上次的最大值insert into backuptable
select 除timestatmp外的所有字段 from table
where timestamp字段 > @最大值select @最大值=max(timestamp字段) from tableupdate 新建表 set 保存的最大值 = @最大值