Dealing with Violation of PRIMARY KEY constraint SSIS How do i deal with this error in SSIS. I'm trying to load a data into an archive table. The package failed and came up with the below error message. I know that there are conflicting keys in the destination table that are being brought over from the source. 

How do I deal with this? Any help will be appreciated. The data is about 30M records.


  [OLE DB Destination [2]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "The statement has been terminated.".
  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Violation of PRIMARY KEY constraint 'PK_xxxxxx'. Cannot insert duplicate key in object 'dbo.mytable'.".
If the primary key is a surrogate (ie an IDENTITY valued INT) then you need to remove it from the field list of the insert (if possible) otherwise (if you need to retain the surrogate key values to support foreign keys) to bracket the insert with set identity_insert on; and set identity_insert off;.