September 8, 2003 at 7:18 am
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?
September 11, 2003 at 8:00 am
This was removed by the editor as SPAM
September 11, 2003 at 12:03 pm
Maybe put a computed column on the primary table and join to that?
Andy
September 16, 2003 at 5:07 am
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
September 17, 2003 at 3:28 am
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