Connecting Tech Pros Worldwide Help | Site Map

how to change the relationship between a primary key and foriegn key?

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 28th, 2007, 08:35 PM
adham
Guest
 
Posts: n/a
Default how to change the relationship between a primary key and foriegn key?

Hey there,

Im not even sure if im using the terminology correctly. Anyway heres
my questions. I have a three tables. The main table has two ID fields.
A website id, which is the primary key in that table, and a
SupplierID.

In the second table, websiteID is not the primary key, so when i want
to relate the table above with this one, its always 1 to many. I need
this to be 1 to 1. what can i do here.

In the third table, the primary key is SupplierID, which is related to
the first table. again the relationship is 1 to many, and i need it to
be one to one.

Also, with the remaining tables, where the relationships are all 1 to
1, each "sub" table displays the correct information from main table.
I need to do this with the table ive just mentioned. is it possible?

regards
adham


  #2  
Old May 30th, 2007, 10:35 PM
Barry Edmund Wright
Guest
 
Posts: n/a
Default Re: how to change the relationship between a primary key and foriegn key?

On May 28, 3:33 pm, adham <adhamsel...@yahoo.comwrote:
Quote:
Hey there,
>
Im not even sure if im using the terminology correctly. Anyway heres
my questions. I have a three tables. The main table has two ID fields.
A website id, which is the primary key in that table, and a
SupplierID.
>
In the second table, websiteID is not the primary key, so when i want
to relate the table above with this one, its always 1 to many. I need
this to be 1 to 1. what can i do here.
>
In the third table, the primary key is SupplierID, which is related to
the first table. again the relationship is 1 to many, and i need it to
be one to one.
>
Also, with the remaining tables, where the relationships are all 1 to
1, each "sub" table displays the correct information from main table.
I need to do this with the table ive just mentioned. is it possible?
>
regards
adham
Do a search on "one to one relationship" in this group. You will find
you need to adjust your thinking in the use of one to one
relationships.

If you want a one to one relationship between tables just give the
primary key in both tables the same name:
tblTable1.lngPrimaryID
tblTable2.lngPrimaryID


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.