I have around 40 delete query statement in a procedure for delete record from multiple tables for foreign key records.
example
Create Proc usp_delete_record(@id int)
as
Begin
Delete from table1 where id=@id;
Delete from table2 where id=@id;
Delete from table3 where id=@id;
Delete from table4 where id=@id;
Delete from table5 where id=@id;
Delete from table6 where id=@id;
Delete from table7 where id=@id;
Delete from table8 where id=@id;
....................
.................
Delete from table40 where id=@id;
End
It is very slow or hang execution.
How to handle this?