Re: Designer 2000, use of foreign keys

From: <Dan>
Date: 1997/10/03
Message-ID: <6130dk$suv_at_drn.zippo.com>#1/1


[Quoted] In article <6WCUXDA30PN0MwmY_at_camk.demon.co.uk>, Andy says...
>
>In article <3433b984.26319019_at_69.0.9.9>, Tim Hall
><tim.hall_at_spambuster.com> writes
>>On Thu, 2 Oct 1997 14:19:10 +0100, Andy Hardy
>><Andy_Hardy_at_camk.demon.co.uk> wrote:
>>
 [snip]
>>>At table level, after running the database wizard, D2K uses the ERD to
>>>determine that a foreign key is required and, therefore, a new column
>>>must be added to the created table to facilitate this. You end up with a
>>>new column called something like 'FE_FIRST_KEY'.
>>>
>>
>>The column should be a copy of whatever forms the unique identifier of
>>the second entity. You should define the UIDs of entities before you
>>start using the database wizard.
>
>I'm still having a little trouble with this - I don't know how to
>determine which of the entities will get the foreign key added to it
>during the conversion to the database schema. I *think* that the entity
>which appears first in the alphabet is given the extra columns during
>the conversion. Surely this can't be right?
> [Quoted]
Right. The way it works is the entity on the "from" end of the realation ship [Quoted] gets the added column. For example:

  • ----------- | Dept | | Emp | | |- - - - ------------<| | | | | |
  • -----------

Where the relationship is "from" EMP "to" DEPT. The EMP table would get the UID [Quoted] of the DEPT table as a column when the tables are created. Basically what you [Quoted] are doing is telling the design tool that the entity on the "from" end is dependant on the entity on the "to" end.

Hope this helps!

Dan Peacock, CNA
Systems Engineer
Great Lakes Hybrids, Inc. Received on Fri Oct 03 1997 - 00:00:00 CEST

Original text of this message