SQL Server default date time stamp?

前端 未结 5 988
轮回少年
轮回少年 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:24

    GETDATE() is a date and time in SQL Server.

    Run SELECT GETDATE() to verify this.

    What is the datatype of your field? If it's DATE then it will not hold time values as well.

提交回复
热议问题