keys

  • Table A:

    PROPERTY

    - PropertyID (primary key)

    - PropertyTypeID (want to be FK!!!)

    - Price

    ...

    Table B:

    PROPERTY_TYPE

    - PropertyTypeID + LanguageID (composite key)

    ...

    Since I cannot have the FK reference a composite PK, what are some ways I can implement this FK relationship?

  • This was removed by the editor as SPAM

  • Maybe put a computed column on the primary table and join to that?

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • In this case either you have to modify your Table A definition like this:

    PROPERTY

    - PropertyID (primary key)

    - PropertyTypeID

    - LanguageID

    - Price

    - ...

    where you use PropertyTypeID AND LanguageID in your PROPERTY table. because you have defined that combinaison as being the primary key

    or you have to modify your PROPERTY_TYPE table by adding for example an IDENTITY primary key and use this key as a forign key in your PROPERTY table.

    But I personnaly don't like this solution

    Bye

    Gabor



    Bye
    Gabor

  • I think you might want to decompose the property_type table. Why is language_id included in the PK?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

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

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