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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append query - key violation

Status
Not open for further replies.

jean2002

Technical User
May 1, 2003
75
DE
Hello,

I have have searched through numerous post in this forum, but I still have the following question:

I have a database with a table say tblPeople. This table contains e.g. the following fields:

ID----NAME----SURNAME----HAND---PERCENT1---PERCENT2
1-----John-------Jones-----(empty)--(empty)---(empty)
1-----Mary-------Masters---(empty)--(empty)---(empty)

ID is the primary key.

Therefore, the data in this table already exists for fields, ID, NAME and SURNAME, but not for HAND, PERCENT1 and PERCENT2.

I then imported data from a spreadsheet into another table, say tblTemp (without primary key) which now contains the data for each person’s HAND, PERCENT1 and PERCENT2, and in this table there is exactly the same amount of records as in tblPeople. I want to add the data from tblTemp top tblPeople now and have used an append query. I get the error message though “not appended due to key violations” for all the records to be added.

Here is the SQL for the append query:
Code:
INSERT INTO tblPeople ( Hand, Percent1, Percent2 )
SELECT tblTemp.Feld1, tblTemp.Feld2, tblTemp.Feld3
FROM tblTemp;

How can I get past this? Thanks for tips in advance!

Regards,
Jean
 
Thanks, but I solved this one now. Used a update query instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top