title: SQL Foreign key issue with Primary Keys
body: <p>I do have a problem connecting two tables on <strong>MSSQL Management studio.</strong>
  My goal is connect tables by foreign key and if I delete user I want 2nd table entry will be deleted automatically. I plan to use DELETE Cascade method for that.</p>
  
  <pre><code>User:
  CREATE TABLE [dbo].[Users](
  [ID] [bigint] IDENTITY(1,1) NOT NULL,
  [Email] [nvarchar](89) NOT NULL,
  [Name] [nvarchar](25) NOT NULL,
  [Midname] [nvarchar](25) NOT NULL,
  [Surname] [nvarchar](25) NOT NULL,
  [Phone] [varchar](15) NOT NULL,
  [Country] [smallint] NOT NULL,
  [Manager] [nvarchar](89) NOT NULL,
  [Referrer] [nvarchar](89) NOT NULL,
  [Rank] [tinyint] NOT NULL,
  CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED 
  (
  [Email] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,      ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]
  
  GO
  
  SET ANSI_PADDING OFF
  GO
  </code></pre>
  
  <p>Email is Primary key</p>
  
  <pre><code>Payments:
   CREATE TABLE [dbo].[Investments](
  [ID] [bigint] NOT NULL,
  [Investor] [nvarchar](89) NOT NULL,
  [Sum] [decimal](19, 4) NOT NULL,
  [Currency] [smallint] NOT NULL,
  [Credit] [decimal](19, 4) NOT NULL,
  [CreditRate] [decimal](19, 4) NOT NULL,
  [Rate] [tinyint] IDENTITY(1,1) NOT NULL,
  [Date] [smalldatetime] NOT NULL,
  [Comment] [nvarchar](max) NOT NULL,
  CONSTRAINT [PK_Investments] PRIMARY KEY CLUSTERED 
  (
          [ID] ASC
   )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,     ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]
  
   GO
  </code></pre>
  
  <p>ID is Primary key</p>
  
  <p><strong>My FK should be like USER->PAYMENTS or PAYMENTS->USER?</strong></p>
  
  <p>When I am trying to connect User -> Payments using foregn key by Email -> Investor, it tell me such error:</p>
  
  <blockquote>
    <p>The columns in table 'Payments' do not match an existing primary key or UNIQUE constraint.</p>
  </blockquote>
  
  <p>Could you please explain me where problem is? And what I am doing wrong?</p>