Upload excel sheet without duplicates records.

Hi Everyone,

I have the requirement so that users can upload excel sheet to the application and save into database table and if the records already exists in table then it will leave that duplicate record.

meaning, duplicate records from the sheet should not be uploaded to the database table. Please suggest me how to get this done.

Thank you,

Shubham

  Discussion posts and replies are publicly visible

  • +1
    Certified Lead Developer

    Hi,

    First you need to save this date in temp staging table, then you need to query staging table and your transitional table and compare your data with your transactional table before writing. If the data already exist  do wrote this data to transactional table other wise write to your table. 

    Note: After you process your date delete data from staging table since you no longer need that data

  • Thanks Naresh, Do you have sample query to compare data from two tables. This would be really helpful.

  • 0
    Certified Lead Developer

    Hi Shubham, I had similar requirement long back. if you are dealing with large data then i would suggest you to create a stored proc to handle all db tasks like update , insert and delete.