所以我想将我的 SQL Server 数据库中的一列更改为不允许空值,但我不断收到错误消息。这是我正在使用的 sql 语句:
alter table [dbo].[mydatabase] alter column WeekInt int not null
这是我得到的错误:
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.
我很确定我的 sql 是正确的,并且我正在尝试更改的列中当前没有空值,所以我真的不确定是什么导致了问题。有任何想法吗?我难住了。