You have to give a default value and the constraint for it has to be given at the moment the column is added like so:
ALTER Table My_Corny_Table ADD The_Date DateTime NOT NULL CONSTRAINT DF_My_Corny_Table_The_Date DEFAULT GETDATE()
No comments:
Post a Comment