I am not able to drop/ remove not null constraint in snowflake DB
Following things I have tried already...
ALTER TABLE tablename
alter
colname datatype DROP NOT NULL,
ALTER TABLE tablename
alter
colname datatype DROP CONSTRAINT NOT NULL,
ALTER TABLE tablename
modify column
colname datatype DROP CONSTRAINT NOT NULL,
ALTER TABLE tablename
modify column
colname datatype DROP NOT NULL,
ALTER TABLE tablename
DROP CONSTRAINT NOT NULL colname
CodePudding user response:
Datatype is not needed for alter column.
alter table tablename modify column colname DROP NOT NULL;
CodePudding user response:
Refer to the documentation, there is an example of what you want to do
alter table t1 alter column c1 drop not null;
https://docs.snowflake.com/en/sql-reference/sql/alter-table-column.html#examples