I have two databases, I want to move some history data from a fact table to another database, the destination table is exactly the same as the source table including all the constrains.
I use a SSIS
package to transfer the data as below:
- first use OLE DB Source to select the data from the source for the required period.
- load it to temp table using OLE DB Destination into the second database.
Then load it to the final table using Execute SQL Task
but I get below error
Error: Violation of PRIMARY KEY constraint 'PK__Financia__362B520524BEA57A'. Cannot insert duplicate key in object 'Fact.FinancialTransactions'. The duplicate key value is (100001 , 2010012, Dec 31 2010 12:00AM, 65, 88).
How do I get around this issue? I want to keep the constrains in the destination table.