Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server Primary/Foreign Keys, Access too

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
US
Hi,

I have an Access database that I have just put onto a SQL Server. I am in the process of creating relationships on the server (or rather, learning how to do so).

I am starting on two tables, RoomHeader and GuestRoom. They both have RoomNumber as their primary key. (GuestRoom tbl is a subset of RoomHeader). When I create relationships on SQL Server, it calls the RoomHeader key a primary key, but the GuestRoom key a foreign key. I thought foreign key was a field that was not a primary key, so why is RoomNumber on GuestRoom being called foreign key? Is it just because it is linked to a primary key on another table? Have I set the tables up wrong in Access?

Thank you,
Lori
 
In a one-to-one relationship the primary key of the second table is the foreign key referencing the first table.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top