Question about relationships - "cycles or multiple cascade paths" error

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I have 2 tables:

Table: UserTable
Field: Id (pk)
Field: FullName

Table: MarriageTable
Field: MarriageId (pk)
Field: Husband
Field: Wife

The MarriageTable.Husband and MarriageTable.Wife fields BOTH have to be
valid users from the UserTable.

In SQL Server I'm creating a relationship diagram. I (1) dragged Id from
UserTable to MarriageTable.Husband and (2) dragged Id from UserTable to
MarriageTable.Wife. But, the Diagram has trouble saving the Wife
relationship. Any ideas? Am I doing this correctly?

Here's the error:
'UserTable' table saved successfully 'MarriageTable' table
- Unable to create relationship 'FK_MarriageTable_UserTable1'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Introducing
FOREIGN KEY constraint 'FK_MarriageTable_UserTable1' on table
'MarriageTable' may cause cycles or multiple cascade paths. Specify ON
DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY
constraints.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint.
See previous errors.

Thanks.
 
Right click on the Husband relationship and remove the « Cascade Update
Related Fields » and the « Cascade Delete Reated Fields ». After having
creating these two relations, you can reset these properties for one of your
relation but not for both of them.

S. L.
 
But, if someone deletes a husband or a wife from the UserTable I want the
record in the MarriageTable to be removed. Is there any way to enforce this
rule?
Thanks!

Sylvain Lafontaine said:
Right click on the Husband relationship and remove the « Cascade Update
Related Fields » and the « Cascade Delete Reated Fields ». After having
creating these two relations, you can reset these properties for one of
your relation but not for both of them.

S. L.

VB Programmer said:
I have 2 tables:

Table: UserTable
Field: Id (pk)
Field: FullName

Table: MarriageTable
Field: MarriageId (pk)
Field: Husband
Field: Wife

The MarriageTable.Husband and MarriageTable.Wife fields BOTH have to be
valid users from the UserTable.

In SQL Server I'm creating a relationship diagram. I (1) dragged Id from
UserTable to MarriageTable.Husband and (2) dragged Id from UserTable to
MarriageTable.Wife. But, the Diagram has trouble saving the Wife
relationship. Any ideas? Am I doing this correctly?

Here's the error:
'UserTable' table saved successfully 'MarriageTable' table
- Unable to create relationship 'FK_MarriageTable_UserTable1'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Introducing
FOREIGN KEY constraint 'FK_MarriageTable_UserTable1' on table
'MarriageTable' may cause cycles or multiple cascade paths. Specify ON
DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY
constraints.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create
constraint. See previous errors.

Thanks.
 
Back
Top