title: Change a column to not allow nulls
body: <p>So I want to change a column in my SQL Server database to not allow nulls, but I keep getting an error. this is the sql statement I am using:</p>
  
  <pre><code>alter table [dbo].[mydatabase] alter column WeekInt int not null
  </code></pre>
  
  <p>and this is the error I am getting :</p>
  
  <pre><code>Msg 515, Level 16, State 2, Line 1
  Cannot insert the value NULL into column 'WeekInt', table 'CustomerRadar.dbo.tblRWCampaignMessages'; column does not allow nulls. UPDATE fails.
  The statement has been terminated.
  </code></pre>
  
  <p>I'm pretty sure my sql is right, and there are no nulls currently in the column I am trying to change so I am really not sure as to what is causing the problem. Any ideas? I'm stumped.</p>