Add Datetime Default Value SQL

Add Datetime Default Value SQL

To create a table with default date time value, you will have to use getdate() as column default value. Be-careful while putting default value that column should not be not null by default. Please have sample create table script where I am keeping primary key incremental by default, column with varchar including date and datetime column.

  • Sample insert statement to insert data to the table:

  • I have inserted sample data which shows below:

Add Datetime Default Value SQL

Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *