I want to insert a default datetime stamp of the the current date and time into a datetime column in a table when a new row is added.
I added (getdate()) to the Default Value or Binding property for the RequestTime Column Name with datetime Data Type.
What I get however when a new row is inserted in the table, rather than seeing the expected current date time, I see
1/1/1900 12:18:12 AM or 1/1/1900 12:00:00 AM
What do I have to do to achieve the results I want.
1.Check your DB server date & time.
2. Try with following SQL
CREATE TABELE TEST1
LMDT DATETIME DEFAULT GETDATE())
INSERT INTO TEST1(EFNAME,ELNAME)
SELECT * FROM TEST1
LMDT Column must show currect date & time.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?