locked
How to overcome the problem of may cause cycles or multiple cascade paths. RRS feed

  • Question

  • Hi Friends
    I am working on the database. I have four table 
    1) Student Information
    2) Select Subject
    3) Course Assign
    4) Academic Batch
    
     In that academic batch primary key goes to student Information table and select subject table as foreign key. In the course assign table the student information and select subject primary key as foreign key. But when I create relation on select subject on delete cascade it give the following error
    
    
    'SelectSubject' table saved successfully
    'CourseAssign' table
    - Unable to create relationship 'FK_CourseAssign_SelectSubject'.  
    Introducing FOREIGN KEY constraint 'FK_CourseAssign_SelectSubject' on table 'CourseAssign' 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.
    
    how do i solve this prooblem 
    



    Thursday, January 14, 2016 6:24 AM

Answers

  • You're not new.  Post DDL of the tables involved and a script that demonstrates your problem - and always identify the version, edition and compatibility level of your server instance and database.  But before you do, simply search on the error message - which is the first thing you should do for any question you have.  This is a common issue and there really isn't a need to spoon-feed you the same suggestions/discussions.  Quite simply - you will need to avoid the use of the delete/cascade option and implement the desired logic in code.
    Thursday, January 14, 2016 1:57 PM