Add default value of datetime field in SQL Server to a timestamp

前端 未结 12 1646
离开以前
离开以前 2020-11-30 17:20

I\'ve got a table that collects forms submitted from our website, but for some reason, when they created the table, they didn\'t put a timestamp in the table. I want it to e

12条回答
  •  借酒劲吻你
    2020-11-30 17:53

    In SQLPlus while creating a table it is be like as

    SQL> create table Test

     ( Test_ID number not null,
       Test_Date date default sysdate not null );
    

    SQL> insert into Test(id) values (1);

     Test_ID Test_Date
           1 08-MAR-19
    

提交回复
热议问题