c# - copy a table to another table with this conditions -


copy table table conditions

  1. if record in old table new copy new table
  2. 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

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -