Do you have a primary key in the table ? Why not use it to check ? How do you intend to do if the server was down for more than 12 hours ? using last 12 hours of time_created will surely missed records created earlier.insert into D2..T2( . . . )select . . .from D1..T1 t1 left join D2..T2 t2 on t1.pk = t2.pkwhere t2.pk is nulland t1.time_created >= dateadd(hour, datediff(hour, 0, getdate()), -12)update t2set . . . . . .from D1..T1 t1 left join D2..T2 t2 on t1.pk = t2.pkwhere t1.time_modified >= dateadd(hour, datediff(hour, 0, getdate()), -12)
KH[spoiler]Time is always against us[/spoiler]