Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2012
    Posts
    22

    Unanswered: Relationship Referential integrity problems

    I am trying to get an older database updated, and I am having problems setting a referential integrity. Everytime I try and link the table with data already in it. it tells me I am not allowed because of violating rules and there are not enough items . When I try and link with nothing in it, I get the same error. How do I set the referential integrity if I already have data in it?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    make certain that the data will support the proposed relationship

    ie realtionship type is correct

    if there is a value in the foreign key that isn't in the primary key then either change the child table (NULL or edit the value OR add the value to the parent table
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2012
    Posts
    22
    So if I am inputting from Number to Number it has to be say long or double, would one of those throw it off? The linking table does not hold a key due to it being a link for a total of 3 tables, should I make the autonumber the primary key on that link? The autonumber is what gets transfered over from 2 tables plus a few other numbers and texts, and one is just text only.

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    This might not be useful to you, but I find it helps to create new tables in this situation, with all the rules in place. Then you can try inserting the data from existing tables, and see what errors you get. You can also try building queries to model the structure of the new tables with the existing data, which can highlight potential problems.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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