views:

62

answers:

1

Assume Table A has two children tables, B and C with cascade delete between A-B, and cascade delete between A-C.

When a row is deleted in A, the matching rows from B and C are deleted.

How does SQL Server determine the order of the Cascades to fire? What I need is to fire the A-C cascade delete before the A-B cascade delete fires.

I know I can do this with triggers, but I don't want to, unless I absolutely have to.

+4  A: 

If the order is that important, this is a database design smell and it also points to the fact that you probably should not be using cascading deletes for this data integrity operation.

Cade Roux
+1 If you can't fire and forget, don't fire.
Marcus Adams