title: SQL Server - Foreign Key constraint may cause cycles or multiple cascade paths
body: <p>Here's my database for a notification system (it has been stripped down for simplicity). When the a User is deleted I want the related Notification and UserEmail to be deleted but I get the constraint may cause cycles or multiple cascade paths error when I try to set the relationship to ON DELETE Cascade.</p>
  
  <pre><code>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.
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ZTvug.png" alt="database diagram"></p>
  
  <p>After doing some research my possible solutions are:</p>
  
  <ul>
  <li>Add an Instead Of Delete trigger to the User table and manually delete the child tables.</li>
  <li>Redesign the tables as suggested here:
  <a href="https://stackoverflow.com/questions/851625/foreign-key-constraint-may-cause-cycles-or-multiple-cascade-paths">Foreign key constraint may cause cycles or multiple cascade paths?</a> However I'm not quite sure what it would like in my case.</li>
  <li>Do a logical/soft delete. (recommended in the comments)</li>
  </ul>
  
  <p>Any recommendations for what I should do?</p>
  
  <p>Additional Resources:</p>
  
  <ul>
  <li><a href="https://technet.microsoft.com/en-us/library/aa902684(v=sql.80).aspx" rel="nofollow noreferrer">Implementing Referential Integrity and Cascading Actions</a></li>
  </ul>