How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?
Beware when the column you are adding has a NOT NULL
constraint, yet does not have a DEFAULT
constraint (value). The ALTER TABLE
statement will fail in that case if the table has any rows in it. The solution is to either remove the NOT NULL
constraint from the new column, or provide a DEFAULT
constraint for it.