How can I insert a bunch of historical information where I want to control the PK, in this case DealID?
I have got 'keep identity' checked.
I check the db, the Id does NOT exist currently.
Error: 0xC0202009 at Data Cleansing, Deal Insert [12194]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "The statement has been terminated.".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Violation of PRIMARY KEY constraint 'PK_DealID'. Cannot insert duplicate key in object 'dbo.Deal'.".If the DealId doesn't currently exist, make sure you don't have a duplicate value in the new (historical) data you're trying to load. The duplication is detected after the new data are loaded, so the duplication could exist within the new data as well as between the new data and the old.
|||The "Check Constraints" box only applies to CHECK and FOREIGN constraints.
Unique, Primary Key, and Not Null constraints are always enforced.
Fast Load is just a wrapper to BULK INSERT. See the CHECK_CONSTRAINTS flag here:
http://msdn2.microsoft.com/en-us/library/ms188365.aspx
No comments:
Post a Comment