簡體   English   中英

如何使用查詢刪除sql server中的非空約束

[英]How to remove not null constraint in sql server using query

我試圖在不丟失數據的情況下刪除 sql server 2008 中的非空約束。

 ALTER TABLE YourTable ALTER COLUMN YourColumn columnType NULL

刪除約束not nullnull

ALTER TABLE 'test' CHANGE COLUMN 'testColumn' 'testColumn' datatype NULL;

刪除列約束: not nullnull

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM