title: CHECK CONSTRAINT on multiple columns
body: <p>I use SQL Server 2008</p>
  
  <p>I use a CHECK CONSTRAINT on multiple columns in the same table to try to validate data input.</p>
  
  <p>I receive an error: </p>
  
  <blockquote>
    <p>Column CHECK constraint for column
    'AAAA' references another column,
    table 'XXXX'.</p>
  </blockquote>
  
  <p>CHECK CONSTRAINT does not work in this way.</p>
  
  <p>Any other way to implement this on a single table without using FK?</p>
  
  <p>Thanks</p>
  
  <p>Here an example of my code</p>
  
  <pre><code>CREATE TABLE dbo.Test 
  (   
  EffectiveStartDate  dateTime2(2)        NOT NULL,
  EffectiveEndDate    dateTime2(2)        NOT NULL
      CONSTRAINT CK_CmsSponsoredContents_EffectiveEndDate CHECK (EffectiveEndDate &gt; EffectiveStartDate),
  );
  </code></pre>