sql server 2008 express - Compare rows in different table having same columns -


i have 2 tables tbl_a , tbl_a_temp. both table have same schema. primary key differ since identity columns. there way can compare 2 rows in these 2 table , know if differ.i inserting data tbl_a_temp tbl_a, need compare make sure not inserting duplicate data in main tables.

regards, amit

i think should work you. basically, since don't have primary key join on, you'll need perform left join on other fields. if different, null check true:

select t.* tbl_a_temp t    left join tbl_a on        t.field1=a.field1 , t.field2=a.field2 , ... a.field1 null 

i've seen others use checksum, have run issues myself returning false positives.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -