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 set it as the default value?
Currently the default value is: (getdate()) Which sets only the date. How do I also set the time?
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
DATEthen it will not hold time values as well.