title: SQL reference another table as foreign key
body: <p>I'm using SQL server 2012 from Microsoft and creating a table using the primary key of another table as foreign key here but it says there is a syntax error</p>
  
  <pre><code>    CREATE TABLE [dbo].[STUDENT]
      (
           STUDENT_ID  int not null Identity,
           SCHOOL_ID INT NOT NULL,
           CONSTRAINT PKEY PRIMARY KEY (STUDENT_ID),
           CONSTRAINT FKEY FOREIGN KEY (USER_ID)  REFERENCES USER (USER_ID)
  
       );
  </code></pre>
  
  <p>it gives me and <code>sql80001 error</code> please help</p>