开发者

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

开发者 https://www.devze.com 2022-12-22 20:44 出处:网络
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 t

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开发者_StackOverflow record in table 2 which is the updated record in table 1. how can i do this?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消