sql - Fill automatic data in second table when insert data in one table -
i have 2 table table1 , table2 , structure of table as
table1 primary key | name table2 primary key | table1_id_pk | status - true/false value when insert data table2 want automatically transfer data in table1 table2 have status false.
you can create after insert trigger:
create trigger datamigration on table2 after insert begin insert table1 select * table2 status = 'false' end go