开发者

How to remove not null constraint in sql server using query

开发者 https://www.devze.com 2023-01-09 07:26 出处:网络
I am trying to remove not null 开发者_如何学Goconstraint in sql server 2008 without losing data. ALTER TABLE YourTable ALTER COLUMN YourColumn columnType NULL

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号