PK - data migration - sql server
Posted on 2011-10-11
I have the following three tables and relationship as follows:
Category (1:M) Type (1:M) Product
The category table is already populated with the data.
I need to migrate data from different tables into Type table.
The Type table has two pk which are Type and Entry. So the combination of
the two columns uniquely identifies the record. The resulted Type table should
look like the following:
Type(PK) Entry(PK) Name Ctgry(FK)
1XS A XXX 100
1XS B YYY 100
The problem is when I try to import data, I get message Insert failed,... violation of primary key,...
I could insert the first record but for the second record I get error message. I am using the query:
Insert into ...
select from .....
how can this be done?
Thanks in advance