title: SQL Server No Matching Keys Error Messages
body: <p>I am trying to execute a database script I created through the Forward Engineer Addin for Microsoft Visio. </p>
  
  <p>The following are the errors I am receiving and the section of the code the error message is referencing: </p>
  
  <p>Error 1: </p>
  
  <pre><code>Msg 1776, Level 16, State 0, Line 12
  There are no primary or candidate keys in the referenced table 'dbo.Account_BillingAccount' that match the referencing column list in the foreign key 'Account_BillingAccount_InvoiceDetail_FK1'.
  Msg 1750, Level 16, State 0, Line 12
  Could not create constraint. See previous errors.
  </code></pre>
  
  <p>Code Reference 1:</p>
  
  <pre><code>ALTER TABLE [dbo].[InvoiceDetail] WITH CHECK ADD CONSTRAINT [Account_BillingAccount_InvoiceDetail_FK1] FOREIGN KEY (
  [BillingAccountNumber]
  , [AccountNumber]
  )
  REFERENCES [dbo].[Account_BillingAccount] (
  [BillingAccountNumber]
  , [AccountNumber]
  )
  </code></pre>
  
  <p>Error 2:</p>
  
  <pre><code>Msg 1776, Level 16, State 0, Line 2
  There are no primary or candidate keys in the referenced table 'dbo.ManagerContract' that match the referencing column list in the foreign key 'ManagerContract_RegionalCoordinators_FK1'.
  Msg 1750, Level 16, State 0, Line 2
  Could not create constraint. See previous errors.
  </code></pre>
  
  <p>Code Reference 2:</p>
  
  <pre><code>ALTER TABLE [dbo].[RegionalCoordinators] WITH CHECK ADD CONSTRAINT [ManagerContract_RegionalCoordinators_FK1] FOREIGN KEY (
  [AssociateID]
  , [WritingNumber]
  )
  REFERENCES [dbo].[ManagerContract] (
  [AssociateID]
  , [WritingNumber]
  )
  </code></pre>
  
  <p>What is the most effective way to remove the aforementioned errors?</p>