Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    7

    Angry Unanswered: Modifying primary key values possible?

    Hi,

    I am attempting to create a linked database from two distinct messy databases of which neither have primary keys.

    So, I'm creating a new Master ID field which links Patron ID and Donor ID. There can be multiple patrons and multiple donors per master ID.

    There could be an instance where I'd like to delete or modify the Master ID because of discovering there is redundancy between different records in my new linkage table. Unfortunately, the data I'm working with is too messy to get it all right the first time around.

    Is it possible to modify keys as long as I'm modifying the values in all the tables in my Relationship? If not, I guess I could just build a flat database with no key but then I guess I'd be building a POS DB.



    Thanks, Leon

  2. #2
    Join Date
    Apr 2003
    Location
    Alabama, USA
    Posts
    154
    Quote Originally Posted by ltrain8535
    So, I'm creating a new Master ID field which links Patron ID and Donor ID. There can be multiple patrons and multiple donors per master ID.
    So you've got a many-to-many relatioinship there.

    If your data is in a flat table, it sounds like you may need to normalize your data into seperate tables. One for Patrons, One for Donors and a junction table.

    What tables and data are in the seperate databases?
    http://AccessDB.Info

    You live and learn. At any rate, you live. - Douglas Adams

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    leon, yes you can, you can even have the changed PK value cascaded to its related FKs

    right click a relationship line in Query Design View to see the options for Relational Integrity
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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