0

I want to restrict duplicates while uploading the excel data and to inform the user that the particular cell in excel contains duplicate value which is already exist in Sql Database.

(Duplicates should be checked in Excel (EMP_ID) against SQL (EMPLOYEE_ID).If duplicate record is found, Message should display as:"User cannot upload the data to with duplicate values. Kindly remove the duplicate fields and re-upload."

Is this possible if any idea can anyone please help me

1 Answer 1

2

You should import the data using SQLBulkCopy into a staging table, the compare values using a join against SQL and return the duplicates back to the user so that he can fix them and re-upload the file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.