That scares me on general principles. I think it would be much better to write application logic to check if there are lines left: after all, you could be deleting records and adding new ones, right?
But you could probably do that with a Delete Trigger on the child table if you really had to.
On Fri, May 30, 2008 at 12:54 PM, John J. Mihaljevic < john.mihaljevic .at. gmail DO.T com> wrote:
> Hi all, > > In a one-to-many relationship, I can easily see how to automatically delete > any child records when the corresponding parent record is deleted. But how > is this done in reverse? When the final child record of a relationship is > deleted, can the parent record automatically be deleted in some way? The > example I'm using is an order. When the final detail line of the order is > completed (and the record is deleted from the OrderDetail table), I'd like > the order header to automatically be deleted from the OrderHeader table. >
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
©2008 Garrett Fitzgerald |