Is it possible to add a logic Constraint to a Foreign Key?

后端 未结 7 1759
闹比i
闹比i 2021-01-05 15:29

I\'ve got two tables and I\'ve added a foreign key constraint. Kewl - works great. Now, is it possible to further constrain that relationship against some data in the parent

7条回答
  •  离开以前
    2021-01-05 16:05

    To give a strong guarantee, you'll need two check constraints going both ways. If you only constrain Mammals someone could update Animals.AnimalType and get the data in an inconsistent state.

提交回复
热议问题