I have a table X. And a trigger has been created on that table FOR Insert and update. From that trigger a stored procedure got called which insert data into another table.
Here is the insert statement :-
insert into y
select A.column1 , case y.column2 is not null then 1 else 0 end
from A
left join y
on y.column2 = A.column2
and <col1> = <col2>
So I am getting a deadlock for this insert from last few days. So is the reading data from the table and inserting the data in same table makes some issue here?