Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

append query key violations

Posted on 2004-04-26
2
Medium Priority
?
500 Views
Last Modified: 2012-05-04
I have an append query:
INSERT INTO SupplierContacts ( [Creditor No], OfficeNumber, FirstName )
SELECT Suppliers.[Creditor No], Suppliers.Phone, Suppliers.Contact
FROM Suppliers;

it fails because of 'key violations'
0
Comment
Question by:robiago
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1500 total points
ID: 10923671
Try this

INSERT INTO SupplierContacts ( [Creditor No], OfficeNumber, FirstName )
SELECT Suppliers.[Creditor No] As [Creditor No], Suppliers.Phone As [OfficeNumber], Suppliers.Contact As FirstName
FROM Suppliers;

Key violations
Do you have any fields with no  duplicates allowed?
0
 
LVL 1

Expert Comment

by:dssdb
ID: 10923708
Key violations are caused by duplicate information being inserted.  You may have data in your Suppliers table that already matches the SupplierContacts.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question