Hi All,
I'm trying to copy data from my local database to the online server, using SQL Server 2005 Management Studio. Im using the Import/Export Wizard which i have used many times before. Theres quite a bit of data - The Data Source Table contains 52,878 records and the Destination Table contains 51,372 records - but i dont think this makes a difference.
I'm enabling identity insert, and appending rows. When i execute the package, it runs and gets through all tasks except when it gets through a few thousand records it errors giving a primary key violation error -
- Copying to [Holidays_Hotels_Dev].[dbo
].[Hot_Ite
m] (Error)
Messages
Information 0x402090df: Data Flow Task: The final commit for the data insertion has started.
(SQL Server Import and Export Wizard)
Error 0xc0202009: Data Flow Task: 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_Hot_Item'. Cannot insert duplicate key in object 'dbo.Hot_Item'.".
(SQL Server Import and Export Wizard)
Information 0x402090e0: Data Flow Task: The final commit for the data insertion has ended.
(SQL Server Import and Export Wizard)
Error 0xc0047022: Data Flow Task: The ProcessInput method on component "Destination - Hot_Item" (64) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
(SQL Server Import and Export Wizard)
Error 0xc0047021: Data Flow Task: Thread "WorkThread0" has exited with error code 0xC0202009.
(SQL Server Import and Export Wizard)
I know the error is pretty self explanatory, but im not sure why this is happening. I've checked for duplicate rows on my source and destination tables and there are none. Is the identity insert not updating on the matching row and instead trying to add a new row with the same ID? If thats the case why does it get through a few thousand records?
Thanks for any help.
Kind Regards,
Fracture
Start Free Trial