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

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -