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 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -