Options

OData - modify primary key

foo_barfoo_bar Member Posts: 91
Hello,

we have a webservice published for a page, and we want to change a value of the primary key for a certain record.
Is it possible, that this is not possible? : )
I can change any other field with an OData patch command, but he seems to ignore all the fields that are included in primary keys.
I understand that this has some danger attached to it, if you change primary key values.
Is there a workaround for this situation?

thank you in advance

Best Answer

Answers

  • Options
    archer89archer89 Member Posts: 337
    create a new record with the needed primary key, copy the data values from the source record to the new record. remove the original record.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • Options
    KishormKishorm Member Posts: 921
    archer89 wrote: »
    create a new record with the needed primary key, copy the data values from the source record to the new record. remove the original record.

    Be careful with this method as it will not maintain referential integrity - I.e. If there are other tables with fields referring to the primary key field(s) of your table then these values would not get changed (like they would with a rename)
Sign In or Register to comment.