I have a DataSet
populated from Excel Sheet. I wanted to use SQLBulk Copy to Insert Records in Lead_Hdr
table where LeadId
is PK.
The answer by Marc would be my recomendation (on using staging table). This ensures that if your source doesn't change, you'll have fewer issues importing in the future.
However, in my experience, you can check the following issues:
Column names match in source and table That the column types match
If you think you did this and still no success. You can try the following.
1 - Allow nulls in all columns in your table 2 - comment out all column mappings 3 - rerun adding one column at a time until you find where your issue is
That should bring out the bug