title: SQL ERROR : "There are no primary or candidate keys in the referenced table..."
body: <p>I'm using SQL Server 2008. I'm getting an error when I try to create the table 'Dossier_Financement':</p>
  
  <pre><code>create table Dossier_Financement 
  (
      ID_Reunion integer foreign key references Reunion(ID_Reunion),
      ID_Dossier integer foreign key references Dossier(ID_Dossier),
      Decision varchar(20),
      Motif text,
      Montant_Retenu decimal(6,2),/* montant accorder */
      Duree_Retenu smallint,/*nb jours accorder */
      Nom_Giac varchar(50) foreign key references GIAC(Nom_Giac),
      primary key(ID_Dossier,Nom_Giac,ID_Reunion)
  )
  GO
  </code></pre>
  
  <p>These are the two tables: </p>
  
  <pre><code>create table Reunion 
  (
      ID_Reunion integer ,
      Date_Reunion datetime,
      ID_Membre integer,/*jquery*/
      Type_Reunion varchar(20),
      Nom_Giac varchar(50),
      foreign key(ID_Membre,Nom_Giac) references Membre(ID_Membre,Nom_Giac),
      primary key(ID_Reunion,Nom_Giac)
  )
  GO
  
  
  create table Dossier_Financement 
  (
      ID_Reunion integer foreign key references Reunion(ID_Reunion),
      ID_Dossier integer foreign key references Dossier(ID_Dossier),
      Decision varchar(20),
      Motif text,
      Montant_Retenu decimal(6,2),/* montant accorder */
      Duree_Retenu smallint,/*nb jours accorder */
      Nom_Giac varchar(50) foreign key references GIAC(Nom_Giac),
      primary key(ID_Dossier,Nom_Giac,ID_Reunion)
  )
  GO
  </code></pre>
  
  <p>The 'Reunion' execute normally without any problem but I get this error when trying to create the second table:</p>
  
  <pre><code>Msg 1776, Level 16, State 0, Line 1
  There are no primary or candidate keys in the referenced table 'Reunion' that match the referencing column list in the foreign key 'FK__Dossier_F__ID_Re__5629CD9C'.
  Msg 1750, Level 16, State 0, Line 1
  Could not create constraint. See previous errors.
  </code></pre>