Consider this self reference table:
create table _test_cascade
(id int not null identity primary key,
other_id int null)
Now, lets try to create a self referencing foreign key:
alter table _test_cascade
add constraint _test_cascade_constraint
foreign key (other_id) references _test_cascade(id)
on delete set null
SQL server (11.0.2100) will give you the infamous error:
Introducing FOREIGN KEY constraint '_test_cascade_constraint' on table
'_test_cascade' may cause cycles or multiple cascade paths. Specify ON
DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY
constraints.
I know from this question that SQL Server is not very good at detecting real cycles and cascade paths, but i cannot understand how is this scenario considered a possible source for such problems, as there is no cascade action and only one foreign key.
This other question is similar, but in that case the self referencing foreign key specifies on delete cascade, which i do understand why is dangerous and should not be permited.
My question is, why is this relationship not permitted?
PD: I know that usually a self referencing table is a db-design "smell", but fixing that design is not an option for me.
Edit:
This has been marked as a duplicate of this other question, but that one is more general and the answers provided do not apply to this scenario, as in this case there is no cascade delete or multiple relantionships specified. I understand the general problem, which i dont understand is why does it applies to this case.