SSIS Duplicate Entry for key PRIMARY



  • I'm creating a simple Pipeline from a SQL Server Database to a MySQL Database, the issue is the pipeline won't work just once, but the more data is added to the first added should also be added in the destination database and here's where it gets hard. I only want to add the new rows to the destination database... i tried but couldn't any suggestions ?



  • I have something similar running in our environment. Here is how we did it. You only have to worry about what you have sent from your SQL Server database. Create an SSIS package to load data into MYSQL, BUT you are going to be using a filter from a table that you create. The primary key is the last record sent.

    The table should look like this.

    Tablename | Key

    Customer 101

    Accounts 521

    At the last step you need to insert into this table the max Primary key ID for the table you sent.

    Then the next time the time the package run just filter the data being sent by the table. Example Select * FROM Customer where PK_ID > 101. Just ensure your package has the correct error handling. Hopefully this makes sense.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2