insert a NOT NULL column to an existing table
问题 I have tried: ALTER TABLE MY_TABLE ADD STAGE INT NOT NULL; But it gives this error message: ALTER TABLE only allows columns to be added that can contain nulls or have a DEFAULT definition specified 回答1: As an option you can initially create Null-able column, then update your table column with valid not null values and finally ALTER column to set NOT NULL constraint: ALTER TABLE MY_TABLE ADD STAGE INT NULL GO UPDATE MY_TABLE SET <a valid not null values for your column> GO ALTER TABLE MY_TABLE