Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Dec 2013
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Deleting a row from tables that have one to one relationship

    My database has two tables, and these tables have One-to-One relationship among each other(By Primary key of each table) , data entry to these tables is done by Data Entry form that I have created, I have entered a wrong Primary key which is common to both tables, I want to correct it but it gives me an error "It is not possible to delete it because it is shared with another table". I what I did was that I have deleted their Relationship first and then I have corrected the primary key in both tables, and after I have established a One to one Relationship again. I don't know whether we have a better solution for that or not, If yes your help will be highly appreciated.

    Thanks a lot

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    I would love to see that database, just a few dummy records in both tables would be sufficient

  3. #3
    New Lounger
    Join Date
    Oct 2012
    Posts
    7
    Thanks
    0
    Thanked 2 Times in 2 Posts
    what database application are you using?

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    The bottom line is that the approach you took is the correct one, and about the only choice. That said, most designers end up using an auto-number field as the primary key, and true one-to-one relationships are rare things unless the database isn't normalized.
    Wendell

Posting Permissions

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