Can I add a not null column without DEFAULT value

后端 未结 10 1520
Happy的楠姐
Happy的楠姐 2020-12-13 07:56

Can I add a column which is I specify as NOT NULL,I don\'t want to specify the DEFAULT value but MS-SQL 2005 says:

ALTER TABLE only allows columns to

10条回答
  •  借酒劲吻你
    2020-12-13 08:31

    Add the column to the table, update the existing rows so none of them are null, and then add a "not null" constraint.

提交回复
热议问题