[英]How to remove not null constraint in sql server using query
我試圖在不丟失數據的情況下刪除 sql server 2008 中的非空約束。
ALTER TABLE YourTable ALTER COLUMN YourColumn columnType NULL
刪除約束not null
為null
ALTER TABLE 'test' CHANGE COLUMN 'testColumn' 'testColumn' datatype NULL;
刪除列約束: not null
到null
ALTER TABLE test ALTER COLUMN column_01 DROP NOT NULL;
參考: 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;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.