View Single Post
  #5  
Old March 19th, 2010, 12:04 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

My Append From Table:

field1 field2
A 2
B 2
C 2

My Append To Table:

field1 field2
A 1
B 1
C 1

Field1 is unique in the Append From table, in the Append To table I have
created a Unique Non-Clustered Index based on Field1 & Field2. The Append To
table has a seperate Unique Clustered Primary Key that is an
Auto-Incrementing Integer. Both tables originate from SQL Server (one is in
SDE, a GIS DbMS). Nulls are not allowed on either side for Field1 but they
are allowed in Field2 in the Append From table.

Thanks for your time on this...

"KARL DEWEY" wrote:

If what you are appending looks like this it will error --
field1 field2
A 1
A
A
B 1
B 2

The second and third records have a null in field2. The third record will
give you the violation.

--
Build a little, test a little.


"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