title: Adding Foreign Key, SQL SERVER 2008
body: <p>I am trying to add a foreign key to a table, and it give me the following error:</p>
  
  <blockquote>
    <p>There are no primary or candidate keys in the referenced table 'tbl_Person' that match the referencing column list in the foreign key 'P_ID'.</p>
  </blockquote>
  
  <p>I have a tbl_Person, which is defined as:</p>
  
  <pre><code>P_ID INT (Primary Key)
  f_Name,
  l_Name
  </code></pre>
  
  <p>the other table is a comments table which is defined as:</p>
  
  <pre><code>C_ID INT,
  Comments,
  P_ID (should be the foreign key)
  </code></pre>
  
  <p>Trying to make a one to many relationship table, so when the user add a comment, it is referenced back to him, also, he can add onto the comments without initializing a new comment. Hopefully that makes a little sense.</p>
  
  <p>Ex: Randy Bing enter "I love SQL", his ID is 1, f_Name is Randy, l_Name is Bing, his comments are "I love Sql". His comments should store a unique ID, as well as import his P_ID. </p>
  
  <p>Later on when Randy wants to add onto the comment with the same C_ID where P_ID matches him without creating a new C_ID.</p>
  
  <p>Here is the Code:</p>
  
  <pre><code>ALTER TABLE tbl_Comments 
  ADD CONSTRAINT P_ID
  FOREIGN KEY (P_ID) 
  REFERENCES tbl_Person(P_ID)
  </code></pre>
  
  <p>Am I close to being on the right track?</p>