View Single Post
  #6  
Old March 19th, 2010, 12:08 PM posted to microsoft.public.access.queries
Nick X
external usenet poster
 
Posts: 66
Default Action Query (Append) didn't add records due to key violations

The PK in the Append To table is allowed to populate on its own, it is not
inclded in the append query. The table has the PK and the aforementioned
index only in the indexes.

"J_Goddard via AccessMonster.com" wrote:

Hi -

We need a bit more detail, but -

You seem to be assuming that the error is caused by field1+field2 duplicates.
Remember that a PK is also "uniquely indexed".

What is the PK in the SQL Server database? Is it an Autoincrement field (I
think it's called that)?
If so, is the append query attempting to add data to that field? (It
shouldn't)

Are there any other indexes that may be causing problems?

John


Nick X wrote:
Hi all,
I am using MS Access 2007 as front-end and SQL Server 2005 as back-end. In
SQL Server I have a PK plus a multi-field index that is unique. I can add
records manually in both Access and SQL, but when I try to run an append
query it throws a key violation error for the records that in field1 are
duplicates but with the addition of field2 in the index are unique. I am
perplexed...

Thanks in advance,
Nick


--
John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201003/1

.