dcsimg
Results 1 to 4 of 4

Thread: Foreign key to two tables

Hybrid View

  1. #1
    Join Date
    Feb 2011
    Posts
    2

    Foreign key to two tables

    Hi, first of all I'm sorry for my bad English but I'm Italian.
    I've a table X with a reference key to the id of another table A. For bakup motivation, every two days I've to move the data from table A to another identical table but named B. If I'm doing this, I've the problem that the table x no more find the entries in the table A and consequently return a reference error.
    The provisional solution that I've found it's to remove the foreign key from the table X. Can you advise a better solution?
    Thanks

  2. #2
    Join Date
    Feb 2011
    Posts
    7
    you can take the snapshot of the Table A into Table B so that the data will be present in both the tables

  3. #3
    Join Date
    Feb 2011
    Posts
    2
    Yes but with this solution I've duplicated data.

  4. #4
    Join Date
    Oct 2010
    Location
    Newark, DE, US
    Posts
    2
    I think you need to reference the ID of table X in table B and A. You will need to define two foreign keys for table B and each foreign key should point to the required fields of one table. It means one foreign key per foreign table.

Tags for this Thread

Posting Permissions

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