c# - copy a table to another table with this conditions -
copy table table conditions
- if record in old table new copy new table
- if record in old table has changed , record existing in new table update record info in new table
making big assumptions trying do, but.... if guessed right, should close :
insert new_table select * old_table not exists ( select * new_table ) update new_table nt old_table ot nt.pk = ot.pk , ( nt.attrib_fld_1 <> ot.atrib_fld_1 or nt.attrib_fld_1 <> ot.atrib_fld_1 or nt.attrib_fld_1 <> ot.atrib_fld_1 or nt.attrib_fld_1 <> ot.atrib_fld_1 -- etc..for many non key fields need evaluated )
Comments
Post a Comment