Key Violations in Append Query

G

Guest

I'm running an append query where I am copying certain records from one table to another. After the query is run and Access tells me how many matching records it is going to append to the new table. I get another message saying that only X number of records are going to be appended to the new table and Y amount of records failed to be appended to the new table because of key violations

What does this mean and how do I recover the Y number of records that failed to be appended to the new table?
 
G

George Nicholson

From Help: (search on "key violation")
--------------------------------------
"I'm getting a key violation message."
A key violation occurs if:

1) You attempt to run a query that appends, deletes, or updates records in a
way that violates the rules of *referential integrity* for related tables.

and/or

2) Your query attempts to append or update records that contain primary key
values that already exist in the destination table.

If you run such a query, it will not modify the records that cause the key
violation.

To modify records in a way that will violate referential integrity, you can
break the relationship between the affected tables or turn referential
integrity off, and then modify the affected tables one at a time. However,
the resulting data in the two tables may then conflict.
---------------------------------------------

Hope this helps,
--
George Nicholson

Remove 'Junk' from return address.


Fred G said:
I'm running an append query where I am copying certain records from one
table to another. After the query is run and Access tells me how many
matching records it is going to append to the new table. I get another
message saying that only X number of records are going to be appended to the
new table and Y amount of records failed to be appended to the new table
because of key violations.
What does this mean and how do I recover the Y number of records that
failed to be appended to the new table?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top