title: Setting up a Foreign Key - transact SQL
body: <p>I'm experiencing an issue with the following tSQL in SQL Server 2014 when assigning a foreign key. Can someone help me in understanding what is incorrect? Thanks - JT</p>
  
  <pre><code>    create table dbo.tbl_Util_Cost
      (
      chr_Grade   nchar(10)    not null Primary Key,
      pct_Target  decimal(18, 2)  not null,
      mon_Cost_Per_Hour   money   not null,
      dec_Daily_Hours decimal(18, 1)  not null
      );
  
      create table dbo.tbl_Team_Details
     (
       num_Personal_Number    numeric(18, 0)  not null,
       chr_Name   nchar(30)    not null,
       chr_Employee_Grade nchar(10)    not null ,
       dt_Start_Date date not null,
       dt_End_Date date   not null,
       foreign key fk_Team_Details1  ( chr_Employee_Grade) references dbo.tbl_Util_Cost (chr_Grade)   
      );
  </code></pre>
  
  <p>I am getting the following error on the Foreign key - </p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 11 Incorrect syntax near
    'fk_Team_Details1'</p>
  </blockquote>
  
  <p>Please advice!</p>