use current date as default value for a column

后端 未结 8 742
心在旅途
心在旅途 2021-02-02 04:43

Is there a way to set the default value of a column to DateTime.Now in Sql Server?

Example:

table Event
Id int (auto-increment) not null
Des         


        
8条回答
  •  囚心锁ツ
    2021-02-02 05:19

    Right click on the table and click on Design,then click on column that you want to set default value.

    Then in bottom of page in column properties set Default value or binding to : 'getdate()'

提交回复
热议问题