Re: Key Violations in Append Queries
- From: "Tom Ellison" <tellison@xxxxxxxxxxx>
- Date: Wed, 19 Apr 2006 11:33:26 -0500
Dear Troy:
Normally, if a primary key or other unique index is created, it is because
the design of the database requires uniqueness for the key involved.
Whoever designed the database supposedly felt this was necessary. Why I do
not know. But this designed feature is working as it should (again assuming
there's good reason for it).
I suppose this is the FormId column in your query. What datatype is this
column? What is its purpose? How does the database use this column? Are
there one or more other tables that are related on this column, and if so,
what are the relationships?
It may be that you should just omit this from the append query, and allow it
to assign new values for that column, but that is not certain. Otherwise,
you're going to be altering the design of the database, and you need to know
what you're doing in that case.
Tom Ellison
"troy" <troy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F680A62B-FCB1-4031-A466-97DEE4987C14@xxxxxxxxxxxxxxxx
I am trying to append rows in a history query to my tables and I get the
big
old key Violations error. It is the same old 3 that keep comming up and
they
dont dissapear from the data***. This is the field that the join is
attached to with the primary key. The numbers below are the same record ID
that keep reappearing and never go away and I get the same old error. Am I
missing something or?
FormId
390
487
705
Here is the complete SQL for the query.
INSERT INTO tbl_History_Form ( FormId, FormNumber, Description,
DigitalSignature, FileName, EffDate, Attachment, FormAvailable,
DateChanged )
SELECT DEV_dbo_TblForm.FormId, DEV_dbo_TblForm.FormNumber,
DEV_dbo_TblForm.Description, DEV_dbo_TblForm.DigitalSignature,
DEV_dbo_TblForm.FileName, DEV_dbo_TblForm.EffDate,
DEV_dbo_TblForm.Attachment, DEV_dbo_TblForm.FormAvailable, Now() AS
DateChanged
FROM dbo_TblForm LEFT JOIN DEV_dbo_TblForm ON dbo_TblForm.FormId =
DEV_dbo_TblForm.FormId
WHERE (((DEV_dbo_TblForm.Description) Not Like
[dbo_TblForm].[description]))
OR (((DEV_dbo_TblForm.FileName) Not Like [dbo_TblForm].[filename])) OR
(((DEV_dbo_TblForm.EffDate)<>[dbo_TblForm].[effdate])) OR
(((DEV_dbo_TblForm.DigitalSignature)<>[dbo_TblForm].[digitalsignature]))
OR
(((DEV_dbo_TblForm.Attachment)<>[dbo_TblForm].[attachment])) OR
(((DEV_dbo_TblForm.FormAvailable)<>[dbo_TblForm].[formavailable]))
WITH OWNERACCESS OPTION;
Any help would be appreciated
.
- Follow-Ups:
- Re: Key Violations in Append Queries
- From: troy
- Re: Key Violations in Append Queries
- Prev by Date: Re: VERY Simple calculation - NEED Help
- Next by Date: Re: Query Performance
- Previous by thread: Re: VERY Simple calculation - NEED Help
- Next by thread: Re: Key Violations in Append Queries
- Index(es):
Loading