There are several possible options that come to mind:
- Configure cascading deletes in the database so that deletion always succeeds.
- Before deleting, check the related records with SELECT. This requires the application to know the limitations.
- A good domain model (business classes) should allow the application to keep abreast of the relevant records.
- O/R, NHibernate.
- SMO (Microsoft.SqlServer.Smo) , . , .