Results 1 to 2 of 2
Mar 20, 2011, 06:54 #1
- Join Date
- Sep 2008
- 0 Post(s)
- 0 Thread(s)
deletion from parent table question
Groan: having re-read this I think the answer is obvious but I feel a bit unsure.
I've got a parent table and a child table.
foreign key constraints are set up correctly I think, using ON DELETE RESTRICT.
I want to deletion from the parent table to be possible only, if the are no related child records.
should my delete statement simply rely on the constraint to decide if deletion is to be effected or should I join on the child table and make sure there are no matching records? (Then, if there is none, perform the deletion)