I want to add the content of a table into another
I tried to copy all fields, except the primary key:
INSERT INTO table2
(field2, field3, field4, ...)
SELECT field2, field3, field4, ...
FROM anotherDB.dbo.t able1
gives the following error:
Violation of UNIQUE KEY constraint...
Cannot insert duplicate key...
Why?
I didn't ask him to copy the key column; Isn't the SQL Server supposed
to know how to increment the key ?
I tried to copy all fields, except the primary key:
INSERT INTO table2
(field2, field3, field4, ...)
SELECT field2, field3, field4, ...
FROM anotherDB.dbo.t able1
gives the following error:
Violation of UNIQUE KEY constraint...
Cannot insert duplicate key...
Why?
I didn't ask him to copy the key column; Isn't the SQL Server supposed
to know how to increment the key ?
Comment