How to remove not null constraint in sql server using query
I am trying to remove not null 开发者_如何学Goconstraint in sql server 2008 without losing data.
ALTER TABLE YourTable ALTER COLUMN YourColumn columnType NULL
Remove constraint not null
to null
ALTER TABLE 'test' CHANGE COLUMN 'testColumn' 'testColumn' datatype NULL;
Remove column constraint: not null
to null
ALTER TABLE test ALTER COLUMN column_01 DROP NOT NULL;
Reference: https://www.tutorialspoint.com/How-can-we-remove-NOT-NULL-constraint-from-a-column-of-an-existing-MySQL-table
ALTER TABLE tableName MODIFY columnName columnType NULL;
精彩评论