Duplicate values Error

I am getting error when i was migrating table from Oracle to SQL Server for CI(case insensitive) database

Violation of PRIMARY KEY constraint 'LXK_INTERFACE_CONFIG_INFOR_PK'. Cannot insert duplicate key in object 'wmdlxk.LXK_INTERFACE_CONFIG_INFO'. The duplicate key value is (CUSTOMER, OUT, TRILLIUM).

But there is only one record as above in oracle Like  (CUSTOMER, OUT, TRILLIUM).

These are the two different records in oracle db

Customer Out Trillium CleanseURL=http://xxxxxxxxxxxx7654/G/Cleanser/CustomerData/PrimaryCustomer/Address;MatchURL=http://trillium_qa.lex.lexmark.com:7654/G/RMatcher/CustomerData/PrimaryCustomer

and

CUSTOMER OUT TRILLIUM selectMaxRetryCountPROP=5;selectMaxBackoffIntervalPROP=2;selectTimeoutPROP=0;updateMaxRetryCountPROP=5;updateMaxBackoffIntervalPROP=2;updateTimeoutPROP=0;PublishMaxRetryCountPROP=5;PublishMaxBackoffIntervalPROP=2;PublishTimeoutPROP=0;URL=http:/xxxxxxxxxx8510/jboss-net/services/TrilliumWebService

But why sql server accepting both as same records and throwing PK voilation error, though the db is CI and last column values are also different.

Please help me in this regard.



December 17th, 2014 12:07pm

use

SET IDENTITY_INSERT <Tablename> ON. then it will allow to insert the records.

More on : http://msdn.microsoft.com/en-IN/library/ms188059.aspx

Thanks,

Free Windows Admin Tool Kit Click here and download it now
December 17th, 2014 12:51pm

I was Using SSMA(SQL SERVER MIGRATION ASSISTANT) tool

December 17th, 2014 2:09pm

Sorry is that contents of multiple columns you posted? If yes then first two values seems to be same Customer OutTrillium  vs CUSTOMER OUTTRILLIUM  since collation is CI ie case insensitive.

So if your pk is on these two columns then it will fail

Free Windows Admin Tool Kit Click here and download it now
December 17th, 2014 3:15pm

I am getting error when i was migrating table from Oracle to SQL Server for CI(case insensitive) database

Violation of PRIMARY KEY constraint 'LXK_INTERFACE_CONFIG_INFOR_PK'. Cannot insert duplicate key in object 'wmdlxk.LXK_INTERFACE_CONFIG_INFO'. The duplicate key value is (CUSTOMER, OUT, TRILLIUM).

But there is only one record as above in oracle Like  (CUSTOMER, OUT, TRILLIUM).


It looks like you have other records in the Oracle database that differ only by case (e.g. 'customer out' or 'Customer Out').  You'll need to specify a SQL Server case-sensitive collation for the problem column if you need to retain these keys that differ only by case.  Perhaps the root cause is a data quality issue in the source database where only a single "CUSTOMER OUT" row was intended.  In that case, it would be best to combine and/or delete the problem source data.

December 17th, 2014 3:31pm

Thanks 
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 4:57am

Thanks
February 18th, 2015 4:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics