key

  • I have a main table that has a composite primary key. Made up of:

    ID1

    ID2

    I want to have a foreign key to the ID2 in another table?

    Is this allowed? (foreign key to part of a composite primary key)

  • NOPE

    Shas3

  • so what can I do?

    i need the composite key and I need a FK to it?

  • what are the rules here?

    work arounds?

  • these tables with the composite PK are lookup tables. I was thinking about just leaving them as standalone tables(no FK relationship to data tables).

    suggestions?

  • Why not create a surrogate single column PK in your table, and then that can be referenced by foreign keys in other tables. This way you will maintain integrity.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply