title: Foreign key refers invalid column in referred table
body: <p><a href="https://i.stack.imgur.com/GCiAm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GCiAm.png" alt="enter image description here"></a>I have a table <code>ClientsPurchases</code> with the column <code>BillNo</code>. I would like to refer BillNo column into <code>Payments</code> table as a Foreign Key, but its showing error.</p>
  
  <blockquote>
    <p>There are no primary or candidate keys in the referred table.
    'ClientsPurchases' that match the referencing column list in the
    foreign key 'FK__Payments__BillNo__286302EC'. Msg 1750, Level 16,
    State 0, Line 1</p>
  </blockquote>
  
  <pre><code>CREATE Table ClientsPurchases
  (
      PurchasesId int IDENTITY(1,1) PRIMARY KEY NOT NULL,
      PurchasesDetails VARCHAR(75),
      [BillNo] varchar(75) NULL 
  )
  
  --My  Payments table as bellow 
  
  
  CREATE TABLE [dbo].[Payments]
  (
      [PaymentId] [int] IDENTITY(1,1) NOT NULL,
      [PayAmount] [decimal](18, 0) NULL,
      [PaymentDate] [datetime] NULL,
      [ClinetId] [int] NULL,
      FOREIGN KEY ([BillNo])  REFERENCES ClientsPurchases(BillNo)     
  )
  </code></pre>
  
  <p>Please advice. </p>