将 SQL Server 中日期时间字段的默认值添加到时间戳 - Add default value of datetime field in SQL Server to a timestamp

问题:

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 enter the exact date and time that the record was entered.我希望它输入记录输入的确切日期和时间。

I know it's in there somewhere, but I can't seem to find how to set the default value (like in Access, you use getNow() or Now() ) but I don't know where to put it.我知道它在某处,但我似乎无法找到如何设置默认值(例如在 Access 中,您使用getNow()Now() )但我不知道将它放在哪里。


解决方案:

参考一: https://en.stackoom.com/question/KVfB
参考二: https://stackoom.com/question/KVfB
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章