SQL Server default date time stamp?

前端 未结 5 977
轮回少年
轮回少年 2020-12-18 20:55

I have a field that when something is inserted I want it to get the current Date & Time and insert this into the database. Is there a way to get the date & time, and

5条回答
  •  离开以前
    2020-12-18 21:36

    SYSDATETIME() will get the current date and time.

    Make sure the data type of the column is datetime, and not just date or it won't be able to hold a datetime.

提交回复
热议问题