Re: Parent-Child relationship
From: james (nospam_at_hypercon.net)
Date: 02/15/05
- Next message: Sue: "Re: Update Rows from other Rows"
- Previous message: --CELKO--: "Re: implementing hierarchy"
- In reply to: PH: "Parent-Child relationship"
- Next in thread: PH: "Re: Parent-Child relationship"
- Reply: PH: "Re: Parent-Child relationship"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Feb 2005 12:44:26 -0600
Only use cascade delete when you are always sure that it never makes sense
to have a child when the parent is deleted. There are cases where it makes
sense for a child to have a null in the FK column, usually this is when
there are multiple Fk's in the child table, BUT, the is usually always ONE
Master table, as in Invoice and InvoiceItem when you must decide to either
cascade delete the InvoiceItem when and Invoice is deleted or to DENY
deleting and Invoice if it has InvoiceItems. This is a business rule that
you must decide on.
JIM
"PH" <PH@discussions.microsoft.com> wrote in message
news:AE79F794-3984-4DE6-949B-C395B817E144@microsoft.com...
>I have a field which is the primary key in table A, and in table B i have
>the
> same field which is the foreign key.When it comes to deleting a record I
> should kill the child first.If i try to delete the parent then i get an
> error, which is expected. But if i turn the delete cascade option on, it
> lets
> me delete the parent first without giving an error.Why?
> Thanks in advance.
- Next message: Sue: "Re: Update Rows from other Rows"
- Previous message: --CELKO--: "Re: implementing hierarchy"
- In reply to: PH: "Parent-Child relationship"
- Next in thread: PH: "Re: Parent-Child relationship"
- Reply: PH: "Re: Parent-Child relationship"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|