Y
y770
I want to insert (duplicate) a record and at the same time to change one of
the fields so it will not have key violation. Here is my SQL statement:
INSERT INTO tmp (ID1, ID2, Field1, Field2, Field3, Field4)
SELECT 99999, ID2, Field1, Field2, Field3, Field4
FROM TableName WHERE ID1=2962
Primary Key in this table is composite key of ID1 and ID2. I am duplicating
a record of ID1=2962 and replacing is with 99999. There are no records for
99999. However, Access gives me error that it cannot insert 7 records because
of 7 key violations.
What do I do wrong?
the fields so it will not have key violation. Here is my SQL statement:
INSERT INTO tmp (ID1, ID2, Field1, Field2, Field3, Field4)
SELECT 99999, ID2, Field1, Field2, Field3, Field4
FROM TableName WHERE ID1=2962
Primary Key in this table is composite key of ID1 and ID2. I am duplicating
a record of ID1=2962 and replacing is with 99999. There are no records for
99999. However, Access gives me error that it cannot insert 7 records because
of 7 key violations.
What do I do wrong?