• Two relationships are two seperate relationships (like role playing dimensions); it's not the same as one relationship with a compound key of 2 columns.

    I think it would be more ideal to create a new surrogate key in your UNION ALL statement (you could use ROWNUMBER()) and create a relationship using that new surrogate key.

    If you use ROWNUMBER(), you better do a full process each time, as the keys might change.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP