>>>>>I have a table where the key field is index a candidate index and field a want change is a regular index. I get the message
>>>>>
>>>>>Failed to update table, Unique index violation
>>>>>
>>>>>The error number is 1884. How do I change the second value, i,e, from a "B" to an"A"?
>>>>
>>>>No, you want to update a field that is involved in Primary or Candidate index :-)
>>>>And that violates the rule.
>>>
>>>I know why I get the message, my question is there a way around the problem,
>>
>>Not if it violates the uniqeness of the key. You would have to make the index a regular index - not primary or candidate.
>
>But then how to I get rid of the original record, is there a way of programatically of temporarily changing the index and then changing it back afterwords.
If you need the data from the original record, copy it to an object or a temp cursor, delete it from the original table, make the new key value whatever you need (that doesn't violate uniqueness) and insert it again. Lots of other ways to do it too.
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________