title: SQL Server 2008 : Subqueries are not allowed in this context. Only scalar expressions are allowed
body: <p>I want to create a database using SQL Server 2008. I have my sql query to create it.
  But everytime I want to execute it, I get this error message :
  "Subqueries are not allowed in this context. Only scalar expressions are allowed."</p>
  
  <p>This is the part of the query where the problem is : </p>
  
  <pre><code>alter table PRODUIT add constraint ID_PRODUIT_CHK
       check(exists(select * from PRODUCTION
                    where PRODUCTION.IdProduit = IdProduit)); 
  </code></pre>
  
  <p>There is something wrong with the "check" but I don't know what.
  Can you help me ?</p>