There is such a table with a DateTime CreationDate field. I want the value to be written to this field only when a new record is added to the database and that this field cannot be NULL . How can I do that?

enter image description here

  • What's the problem? the screenshot shows that this has already been implemented - Default Value or Binding = (getdate()) & Allow Nulls = No - Anatol
  • @Anatol, since it is worth Allow Nulls - No then I am obliged to write the value in this field myself? - Lightness
  • Everything is correct, set default, set not null, but there is still a feature; when inserting, it is not necessary to include this field in the insert, i.e. insert into table1 () values () should not be CreationDate and fields should be specified. - nick_n_a
  • since it costs Allow Nulls - No, then I am obliged to write the value in this field myself? - no, it will be done automatically - Anatol
  • @nick_n_a why should not? let him insert what he wants, the default does not prevent to set his own values - Anatol

0