I’ve 2 tables, tr_test1 & tr_test2 with same schema. Also the data is same in both the tables.I wrote a trigger, which will delete a row from the table tr_test2, when a corresponding row is updated in tr_test1 table.create table tr_test1 (id int,name varchar(100)) insert into tr_test1 select 1,'name1' union allselect 2,'name2' union allselect 3,'name3' union allselect 4,'name4'select * into tr_test2 from tr_test1CREATE TRIGGER tr_test ON tr_test1 FOR update AS DELETE FROM tr_test2 where id in (select id from deleted)update tr_test1 set id = 5 where id = 4
It works fine, when I execute the query like update tr_test1 set id = …. , and the corresponding row is deleted from the tr_test2 table.But, in object Explorer – Right click table tr_test1 – open table, when I try modify a value, it throws me the following error…No row was updated.The data in row 3 was not committed.Error source: Microsoft.VisualStudio.DataTools.Error Message: The tor value(s) updated or deleted either do not make the row unique or they alter multiply rows(2 rows)Correct the errors and retry or press esc to cancel the change(s).Any thoughts on ths would immensely help me…