將 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章