Hello,
First, I have a parent table which contains a composite Primary Key of KeyValue1, KeyValue2.
There is a bit column in the table which mostly has values of 0, but occasionally has a 1.
I want to add a Unique Filtered Index to this parent table on KeyValue1, KeyValue2, WHERE bit column = 1.
Second, I have a child table with non unique values of KeyValue1, KeyValue2. I want to add a foreign key referencing the unique filtered index in the parent table, to prevent rows from being added if KeyValue1 and KeyValue2 are NOT in the filtered index of the parent table. Is there a way to specifically tell the foreign key to use the unique filtered index INSTEAD of the primary key, when I create the FK?
(I am trying to avoid creating and maintaining a 3rd "parent of the parent" table with the filtered key values. )
Thanks,
Brad