Could the foreign key prevent..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 tables (source) in my update query. One table has two primary keys.
It feeds into another table using only the product id primary key which feeds
into the target table using the primary key also named product Id. I receive
a key violation error when I try to Updte. Would this foreign key have
anything to do with this error? I have checked everything else possible with
all the indexes etc but maybe I am missing something. Please help!
 
A table can only have ONE primary key. A table can have a compound primary
key consisting of two or more fields to form a unique data combination. If
you tried to relate half of a compound key it will not work.
 
What I have is a number primary key and a date primary key. I am not trying
to use either of the keys in my update query. Shouldnt this still work? If
not what is the solution. Thank you
 
What I have is a number primary key and a date primary key.

You are mistaken.

You do NOT have two primary keys in your table. It is IMPOSSIBLE for a
table to have two primary keys (in Access, in SQL/Server, in MySQL, in
Oracle, or in any other DBMS that I'm aware of).

A table can have one, and only one, primary key.

That key might consist of two fields.


John W. Vinson[MVP]
 
Back
Top