Hi
I am using sql import/export wizard in server 2000 to import data from oracle. I got an following error when I try to copy a table cross to existing table in sql server with existing data:
Can not insert duplicate key row in object TABLE_NAME with unique index TABLE_NAME_I
Does import funtion in sql server 2000 not allow to overwrite the data? If it does, how to configure it to overwrite the existing records? I try to tick Enable identity insert box but it doesn't work.
Any idea? Please help
Thanks
Li
It does allow to overwrite existing data...
If you are using the wizard...I believe it is 5th window called "select source table and views" click the transform button (...) , another window called "Column mapping and Transformations" will popup where you can choose the option to overwrite the data...
|||Yes, that's what I have tried to do, but it seems not working.
What I have odne:
In Column mappings and transformation window
select Appending rows to destination table, then choose Enable identity insert.
After I have done that, it still doesn't allow me to overwrite the existing data.
Li
|||I think that 'Over write existing records' checks for completely duplicate rows. Perhaps you have a rows that have duplicate values in the Unique Index, but other fields are not duplicate, so the import process is trying to import the non-duplicate row.
You need to find and correct the duplicate key values -or remove that column from the import. I recommend importing data into a 'staging' table, then you can easily add a WHERE criteria to the INSERT..SELECT statement that does not attempt to insert the rows with duplicate key values. Then you will have identified the rows that need 'correction' and can take appropriate action.
No comments:
Post a Comment