If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Default value in datetime column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-05, 08:57
elorob elorob is offline
Registered User
 
Join Date: Sep 2005
Posts: 4
Default value in datetime column

Does anyone know the create table syntax to create a timestamp column that defaults to curtime(). This is to provide an audit trail for table inserts?

Thanks,

DG
Reply With Quote
  #2 (permalink)  
Old 10-17-05, 04:22
Chagh Chagh is offline
Registered User
 
Join Date: May 2005
Posts: 127
hi,
the default value for timestamp column is current date and you do not need to set a default value for it. see The DATETIME, DATE, and TIMESTAMP Types
to create a table with timestamp column:
Code:
create table test (fieldName TIMESTAMP);
for more info see create table

--Regards
Chagh
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On