I have a table with an identity column (say Column1
) and an integer column Column2
(nullable)
While inserting a row into this table, if the value passed to the Column2
is null, copy the Column1
value. If not null value is passed as argument for column2
, retain the given value.
Only after the every insert, this check and update should be done.
But as per the instruction given to me, should not use default constraint and trigger (after insert).
This is for audit purpose. The record from this table will be moved/switched from one table to another table. The volume and transaction is very high (billions of records).
Can you help me on this?
Thanks, Baskaran