I am working on both parts of a data layer. I get to create the procs, and the business object layer that will consume the procs.
Is there a best practice for determining where a delete should occur?
Here's the scenario. I have a table Book with foreign key to a child table Pages. If I delete the book, I also want to delete the pages. If the deletion of a page fails, I want the whole book to stay (transaction).
Should the delete occur in managed code (by creating a transaction, deleting all child objects and finally the book), or in the proc (again in a transaction)?
Or does it matter?