尝试在Auzre数据仓库中将列更改为非null时收到错误

时间:2020-11-11 07:45:14

标签: tsql azure-synapse

我试图将列从null更改为not null。我收到此错误。 enter image description here

我尝试删除收到此消息enter image description here的统计信息。

这是表格信息

enter image description here

我应该怎么做才能更新此列?

1 个答案:

答案 0 :(得分:0)

如果要将“ NOT NULL”更新为“ NULL”,则语法不正确。必须是如下

ALTER TABLE staging.watermarktable ALTER COLUMN watermarkdate datetime NULL ;

下面是删除的方法,如果您希望在启用统计信息后从NULL转换为NOT NULL

enter image description here