I have a table A which has primary key column a and it is a foreign key to B table (Table B has primary key b and column a). Table B also has a primary key b which foreign key to C table and so on.
It won't allow me to delete a row from table A because its dependent on table B and table B is dependent on table C. So I have to delete a row from C first then B and at last A manually.
Is there any way to delete directly without going to each table and checking if it has any dependencies before deleting?
You Can Use Cascade Cascading Referential Integrity Constraints
Update: you should enable Cascading Referential Integrity Constraints of Table A (PK) from Table B where ID of A is foreign Key and similarly of PK of Table B From Table C Where ID of B is foreign Key
Very Nice Article BLOG.SQL AUTHORITY