Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005

    Unanswered: Problem Creating One-To-Many Relationship

    Hi guys,

    I'm testing some stuff. I have two tables, table1 has a primary key and table2 only has a column. When I try to create a relationship between them, SQL Server complains.

    Here's my code:
    Alter Table Table1 
    Add Constraint FK_T1 Foreign Key (T1) References Table2(T1)
    And the error:

    There are no primary or candidate keys in the referenced table 'Table2' that match the referencing column list in the foreign key 'FK_T1'.


  2. #2
    Join Date
    Sep 2005
    OK guys, I found what was wrong.

    I should go and kill myself for posting this question, now that I realize how stupid it is

Posting Permissions

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