title: SQL Server Management Studio - adding foreign key confusing?
body: <p>I always find it confusing to add foreign keys to primary table in Management Studio. </p>
  
  <p>Lets say I have a </p>
  
  <pre><code>Table1 
  {
      ID int, -- Primary Key
      Table2ID int, -- Refers to Table2's ID 
  }
  
  Table2 
  {
      ID int, -- Primary Key
      SomeData nvarchar(50)
  }
  </code></pre>
  
  <p>I am adding a foreign key to Table1 by <code>Right Click -&gt; Relationships -&gt; Table and column specification</code>. I am setting "Primary" popups to Table2, ID and "Foreign Key Table" to Table1, Table2ID.</p>
  
  <p>My questions:</p>
  
  <ol>
  <li><p>Shouldn't Table2 be listed for
      "Foreign Key Table" and Table1 for
      Primary Key? Is my understanding
      wrong? </p></li>
  <li><p>When I save I get an alert "The following tables will be saved to your database." and it shows both tables. I really don't get this. I only changed Table1. Why is the second table shown?</p></li>
  </ol>