📜  使用默认值 sql server 将列更改为不为空 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:36.243000             🧑  作者: Mango

代码示例1
ALTER TABLE SomeTable
        ADD SomeCol Bit NULL --Or NOT NULL.
 CONSTRAINT D_SomeTable_SomeCol --When Omitted a Default-Constraint Name is autogenerated.
    DEFAULT (0)--Optional Default-Constraint.
WITH VALUES --Add if Column is Nullable and you want the Default Value for Existing Records.