I have a DB where 3 of the tables have a FK relationship inasmuch as:
Table A has 2 (relevant) fields:
TypeId (int)
LinkId (int)
Tables B and C each have a primary key that maps to the LinkId in Table A. If the TypeId in Table A is 1 then the LinkId maps to the primary key in Table B. If it's 2 then it maps to the primary key in Table C.
In this badly designed DB is there anyway to enforce referential integrity among these tables? i.e. Is it possible to prevent SQL Server from inserting a record in Table A if the corresponding record does not exist in Tables B or C?