title: Should a foreign key be created on the parent table or child table?
body: <p>What's the difference? If I have these two tables:</p>
  
  <pre><code>CREATE TABLE Account (Id int NOT NULL)
  
  CREATE TABLE Customer (AccountId int NOT NULL)
  </code></pre>
  
  <p>And I want a foreign key linking the two, which of the following should I do and why?</p>
  
  <p>Option 1:</p>
  
  <pre><code>ALTER TABLE [dbo].[Customer]  WITH CHECK 
    ADD  CONSTRAINT [FK_Accounts_Customers] FOREIGN KEY([AccountId])
    REFERENCES [dbo].[Account] ([Id])
  </code></pre>
  
  <p>Option 2:</p>
  
  <pre><code>ALTER TABLE [dbo].[Account]  WITH CHECK 
    ADD  CONSTRAINT [FK_Accounts_Customers] FOREIGN KEY([Id])
    REFERENCES [dbo].[Customer] ([Id])
  </code></pre>