Re: Many-to-many with both FK cascading deletes?
Date: Sun, 20 Jun 2010 16:16:17 -0700 (PDT)
Message-ID: <e5eef878-3177-420c-a67a-84797b26c47c_at_5g2000yqz.googlegroups.com>
On 20 jun, 15:35, -CELKO- <jcelko..._at_earthlink.net> wrote:
> >> are there any complications in general with a many-to-many "join table" having cascading deletes on both foreign keys to the interconnected tables? After all, this means that the "link entities" get deleted whoever comes first... could this pose a problem? <<
>
> The ANSI/ISO model is that first you mark all the rows in all the
> tables with a delete flag. If no constraints are violated, then a
> second pass does the actual removal. If a constaint is violated at any
> point, then the engine does a rollback and sends an exception.
>
> The multiple passes can be expensive, but they are safe.
Is the SQL standards crew now also prescribing how implementations should be done ? Received on Mon Jun 21 2010 - 01:16:17 CEST