sql PRIMARY KEY constraints violated, not insert duplicate key in a subject

The data show that you there are duplicate records

two cases

1 and tables existing between the repeated data to be imported

at this time can be an association between two tables, a primary key to identify duplicates cascade

2. To import table there are duplicate records

may be similar to the following statement by duplicate records in a table to find out

select StudentCode from StudentScore group by StudentCode [PRIMARY KEY field here] having count (*)> 1 

records and delete duplicate by finishing on it

Guess you like

Origin www.cnblogs.com/kelly1314/p/11442202.html