title: Is there a way I can create a constraint that checks the value of two columns in SQL Server?
body: <p>I have this DDL:</p>
  
  <pre><code>CREATE TABLE [dbo].[AdminTest] (
      [AdminTestId]  INT            IDENTITY (1, 1) NOT NULL,
      [Title]        NVARCHAR (100) NOT NULL,
      [CreatedBy]    INT            NOT NULL,
      [CreatedDate]  DATETIME       NOT NULL,
      [ModifiedBy]   INT            NOT NULL,
      [ModifiedDate] DATETIME       NOT NULL,
      [TestLevelId]  INT            NOT NULL,
      [TestStatusId] INT            NOT NULL,
      [ExamId]       INT            NOT NULL,
      [Text]         NVARCHAR (MAX) NULL,
      [Sequence]     INT            DEFAULT ((1)) NOT NULL,
      [Release]      NVARCHAR (50)  DEFAULT ((1)) NOT NULL,
      [Version]      ROWVERSION     NOT NULL,
      [Price]        MONEY          DEFAULT ((0)) NOT NULL,
      [ReleaseDate]  DATETIME       NULL,
      [Code]         VARCHAR (10)   DEFAULT (LEFT(newid(), (5))) NOT NULL
  );
  </code></pre>
  
  <p>Is there a way that I can require the <code>ReleaseDate</code> to have a value IF the value of the <code>Release</code> column is 2 ?</p>