ereffe
ereffe

Reputation: 1

after running insert or update query, need the last inserted record and compare in vb.net sql server

i have 2 queries in vb.net with an if clause - if x=0 then insert into table1 else update table1

both queries have 5 fields. now what i want to do is after this insert or update takes place, i need to look at this inserted/updated record and compare it with another table (table2). Especially for update, i have 5 fields in both tables. if any of the 5 fields dont match with table2, then i insert a new record in table 2 which is the updated record in table 1. how can i do this?

Upvotes: 0

Views: 218

Answers (1)

Joel Coehoorn
Joel Coehoorn

Reputation: 416083

You could use a trigger and keep this all on the database.

Upvotes: 1

Related Questions