command used to change the contents of the primary key ?

jazzz345jazzz345 Member Posts: 4
What is the command used to change the contents of the primary key permanently in the table in Navision 4.0?

Comments

  • SavatageSavatage Member Posts: 7,142
    you mean you would like to rename some key fields?
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    You can use
    RENAME
    
    but this operation might take a very long time.
    For normal it is better to create a new record and delete the old one. But it depends on what you exactly want to do.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • kinekine Member Posts: 12,562
    You can use
    RENAME
    
    but this operation might take a very long time.
    For normal it is better to create a new record and delete the old one. But it depends on what you exactly want to do.

    This is dangerous! If you do not know all consequences, do not use this "quick" way, because it will took you much more time to solve the problems...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,305
    For normal it is better to create a new record and delete the old one. But it depends on what you exactly want to do.
    No most definately NOT the way to go for regular code. There is a reason why there is a RENAME operation, it takes care of all table relationships for you. Only go the delete/insert route if you know ALL relationships and you explicitly take care of those yourself. Other than that, as a general rule you should always use RENAME.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    As I said.
    But it depends on what you exactly want to do.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • DenSterDenSter Member Posts: 8,305
    You said:
    For normal it is better to create a new record and delete the old one.
    Which I interpreted as an advice from you that you think this is "the normal, regular, recommended" way to do this, when in fact it is a "last resort, only in exceptional cases, and only if you are well aware of all implications" way of doing it.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Oh.... indeed it is normal! ...depending on what you want to do. Take a look at e.g. Sales Quote -> Make Order.
    But I agree with you, my first post could be capable of being misunderstood. But I thought only an advise to RENAME isn't the whole truth. What do you think?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • kinekine Member Posts: 12,562
    You cannot tell whole truth each time... ;-) People must be prepared for whole truth... Give the whole truth into hand of unprepared man and he will screw it and use it as he wish, mainly if it can hurt someone... :whistle:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.