user1110441
user1110441

Reputation: 11

ssis error coming when ever we r trying to load the data into sql server tables

The input file name is employee and it contain the data like:

eno,ename,esal
1,sravan,2000
2,kumar,12000
3,naresh,10000
3,sathish,1500

I need to load this data into a sql server table that is emp table, but the eno field is a primary key. When I tried to insert the data, I was given an error. So how can I resolve this problem?

Upvotes: 1

Views: 104

Answers (1)

David Benham
David Benham

Reputation: 1174

Assuming I understand what you are asking, you are receiving an error because you are trying to insert the same ENO (3rd record and 4th record both containing an ENO of 3) into the primary key. Your primary key uniquely identifies each record in the table. Primary keys cannot contain nulls and must be unique.

You can either modify the SQL table by adding an auto-incrementing field and allow that new field to become your primary key, or clean your data only allowing unique ENOs to be passed through to your SQL server table.

Upvotes: 1

Related Questions