So, I want to change the column in my SQL Server database to not allow null, but I keep getting the error. this is the sql statement i am using:
alter table [dbo].[mydatabase] alter column WeekInt int not null
and this is the error I get:
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.
I am sure my sql is correct and there are no zeros in the column I'm trying to change, so I'm really not sure what causes the problem. Any ideas? I'm at a dead end.
null sql-server alter-column
user2255811
source share