|
Home > Archive > Microsoft SQL Server forum > June 2005 > Date/Time Stamp
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Robert 2005-06-07, 9:23 am |
| When a record is written to a table (via a asp form), I'd like the time
and date from the server to automatically populate a column in that
table. From what I can tell, timestamp isn't working. I rather not
have the time come from the client.
Thanks for the help.
| |
| David Portas 2005-06-07, 1:23 pm |
| Add a column with a default of CURRENT_TIMESTAMP. This is nothing to do
with TIMESTAMP, which is the SQL Server keyword for a row-versioning
column, not for date and time.
ALTER TABLE your_table ADD date_created DATETIME NOT NULL
CONSTRAINT df_your_table_date_c
reated DEFAULT CURRENT_TIMESTAMP
--
David Portas
SQL Server MVP
--
| |
|
|
|
|
|