I have 2 basic questions
1. Can you pls explain more about what you are trying to do?
2. I understand that you are trying to maintain a unique index (or a primary key). In that case why do you even go to the step of checking if there is duplicates , if you can actually create a unique id before inserting.
That will be a redundant action and sure the performance will be degraded because you are "updating" an indexed field.(index sort and stuff like that)
but to have a more clear understanding of the problem need more info on this
I have declared a cursor by joining 4 tables.Cursor may have duplicate values,whenever duplicate value comes,I will update the table with new value.But I am sure,I am not updating unique indexed column.I found the problem in updating the foreign key column of the table.Foreign key columns are required for that table.Do you have any idea to overcome this problem? Is this clear?