SQL Server - 外键约束可能会导致循环或多个级联路径

时间:2015-04-09 19:05:16

标签: sql-server

这是我的通知系统数据库(为简单起见,它已被删除)。当用户被删除时,我希望删除相关的Notification和UserEmail,但是当我尝试将关系设置为ON DELETE Cascade时,我得到约束可能导致循环或多个级联路径错误。

Unable to create relationship 'FK_Notification_TargetUser'.  
Introducing FOREIGN KEY constraint 'FK_Notification_TargetUser' on table 'Notification' 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 or index. See previous errors.

database diagram

在做了一些研究后,我可能的解决方案是:

对我应该做什么的任何建议?

其他资源:

0 个答案:

没有答案