Hello!
It seems like I have some misunderstandin g about the way transactions
work and would appreceate your help.
I want to delete records from 2 tables. Some records may not be
deleted due to reference constraints in which case no effect must take
place (i.e. no records must be deleted).
The following SQL code was supposed to solve my problem but it
doesn't..
BEGIN TRANSACTION
DELETE A WHERE ID=1
DELETE B WHERE ID=1
COMMIT
It still deletes A records if records in table B cannot be deleted.
What do I miss?
It seems like I have some misunderstandin g about the way transactions
work and would appreceate your help.
I want to delete records from 2 tables. Some records may not be
deleted due to reference constraints in which case no effect must take
place (i.e. no records must be deleted).
The following SQL code was supposed to solve my problem but it
doesn't..
BEGIN TRANSACTION
DELETE A WHERE ID=1
DELETE B WHERE ID=1
COMMIT
It still deletes A records if records in table B cannot be deleted.
What do I miss?
Comment