Multiple column foreign key contraints
- by eugene4968
I want to setup table constraints for the following scenario and I’m not sure how to do it or if it’s even possible in SQL Server 2005.
I have three tables A,B,C. C is a child of B. B will have a optional foreign key(may be null) referencing A. For performance reasons I also want table C to have the same foreign key reference to table A. The constraint on table C should be that C must reference its parent (B) and also have the same foreign key reference to A as its parent.
Anyone have any thoughts on how to do this?