> i am getting following error in sql
> server express while defining foreign
> key could any body resolve my problem
>
> > 'tbl_branch' table saved successfully
> > 'tbl_students' table
> > - Unable to create relationship 'FK_tbl_students_tbl_branch'.
> > Introducing FOREIGN KEY constraint
> > 'FK_tbl_students_tbl_branch' on table
> > 'tbl_students' 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.
> >
> > > Blockquote
> i am getting following error in sql > server express while defining foreign
Share
I’m pretty sure this is warning that you have a “circular reference” with your foreign keys; i.e. tbl_branch has a foreign key that points to tbl_students and tbl_students has one that points to tbl_branch.
Specifically the problem is that you have cascading deletes or updates switched on. This means when you delete a row in tbl_branch, it’ll try to delete the associated record in tbl_students, which will try to delete the associated record in tbl_branch, etc. In other words you may cause cylclical cascading deletions.
Either switch off cascading deletes/updates, or remove the “circular” foreign keys.