We have 2 Tables, One is Primary Table and another one is a Transaction Table. Both Tables are identical.
We have to insert or update the record in Primary Table, based on Transaction Table.
If a record is found identical on primary keys for Primary and Transaction Table, we would update, else we need to insert the record in Primary Table.

Recommended Answers

All 2 Replies

I think good example to use triggers!

You use a trigger on the main table that will uodate on insert to the other table whenever a query is run

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.