Hi- I have a situation where the FK to a table could come from three different tables. As an example I have TableA, TableB and TableC. TableD could be a child table with Ids from any of the first three tables. For any row, it will have the Id from only one of the above three tables. So I have two design options. First,
The first design is MUCH better. You can declare foreign key constraints to enforce the integrity between table D and tables A, B, and C. If you really need it, you can create a CHECK constraint to insure that only one of the three FK values is NOT NULL, but I wouldn't do that because it has always bitten me in the past (there is always an exception, and sometimes the baseline rules change to allow more than one non-null value).