Results 1 to 4 of 4

Thread: primary key

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: primary key

    Hi all I need to change the primary key from [Parent ID] to ParentID, the problem is I know it will effect all the tables related to it and all the forms. what is the best way of doing this with very little hassel??

    thank you

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Are you simply renaming the column? Or is this a second column in the table?

    If renaming, then you will need to drop the foreign key constraints that refer to the primary key, drop the primary key itself, rename the column, then add the constraints back in from before. So long as no one is trying to insert data behind your back, it should go smoothly.

    If you are changing the primary key to be a different column, then there may be problems with some child records may no longer have parent records, and some parents may even swap children, unless all of the values in both columns are the same across the board.

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Hi MCrowley I am renaming it

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    If you have scripts of all the constraints, it should be no problem at all. You may also want to set up a table in a test system that you can test the process a few times on, just so you can get the feel of how it goes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •