I have a table messageTable
with this structure:
id,
fromId,
toId,
text
and another table profileTable
with these columns:
profileId,
name,
location
profileId
is a foreign key referred to from the messageTable
for the columns fromId
and toId
.
I want to add option for cascade rule on delete for both fromId
and toId
. But I get this error:
'Profile' table saved successfully
'Message' table
- Unable to create relationship 'FK_Message_Profile1'.
Introducing FOREIGN KEY constraint 'FK_Message_Profile1' on table 'Message' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint. See previous errors.
I have tried in mysql, it's working fine there. But it is not working in SQL Server 2008