title: Cannot define PRIMARY KEY Constraint on nullable column when column is already NOT NULL
body: <p>I have a table called <code>Cases</code> that has information about interviews such as <code>IV_Date</code>, <code>IV_Length</code>, <code>Interviewer</code>, etc. I also have a field within <code>Cases</code> called <code>Case_Code</code> (a <code>varchar</code>) which is a six-character (three letters + three numbers) identifier; e.g. "ABC123" or "ZZZ999." There is a foreign key on <code>ContactID</code> (an <code>int</code>), which points to a <code>Contact</code> table. I have created a computed column which is the PRIMARY KEY of this <code>Cases</code> table, called <code>CaseID</code>. <code>CaseID</code> is simply a concatenation of <code>Case_Code</code> and <code>ContactID</code>. So, <code>ContactID</code> "25" working on case "ZZZ999" is given a <code>CaseID</code> of "ZZZ99925". Neither <code>Case_Code</code> nor <code>ContactID</code> accepts nulls, so <code>CaseID</code> obviously does not. When setting up <code>CaseID</code> I created it as NOT NULL, PRIMARY KEY, and used the formula "[Case_Code] + CONVERT([varchar], [contactID], 0)". I thought everything was working fine but when I try to rearrange any fields in the SQL Studio table design view, I get thrown this error:</p>
  
  <pre><code>'Cases (dbo)' table
  - Unable to create index 'PK_Cases_1'.  
  Cannot define PRIMARY KEY constraint on nullable column in table 'Cases'.
  Could not create constraint. See previous errors.'
  </code></pre>
  
  <p>I do not understand why I'm getting this error, since all NOT NULL columns in my table contain data. Any help or ideas would be greatly appreciated. Thanks!</p>
  
  <p>Edit with code:</p>
  
  <pre><code>CREATE TABLE [dbo].[Cases](
      [ContactID] [int] NOT NULL,
      [Case_Code] [varchar](16) NOT NULL,
      [Assigned_To] [varchar](100) NULL,
      [LEK_Interviewer] [varchar](255) NULL,
      [Case_Notes] [varchar](max) NULL,
      [IV_Status] [varchar](100) NULL,
      [IV_Quality] [numeric](18, 0) NULL,
      [IV_Date] [date] NULL,
      [IV_Length] [varchar](50) NULL,
      [Address] [varchar](100) NULL,
      [City] [varchar](100) NULL,
      [State] [varchar](50) NULL,
      [Zip] [varchar](25) NULL,
      [Country] [varchar](50) NULL,
      [Total_Honorarium] [money] NULL,
      [Currency] [varchar](20) NULL,
      [Last_Update] [varchar](50) NULL,
      [CaseID]  AS ([Case_Code]+CONVERT([varchar],[contactID],0)) PERSISTED NOT NULL,
      CONSTRAINT [PK_Cases_1] PRIMARY KEY CLUSTERED 
      (
          [CaseID] ASC
      )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,        ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
      ) ON [PRIMARY]
  </code></pre>