sql server , mysql , sqlite 的时间字段的默认值
2008-07-30  作者:amao  同分类文章
description:
在sql server里面字段类型是 datetime , 默认值可以用 getdate()   ,  或者 CURRENT_TIMESTAMP.  注意不能给timestamp类型的字段设置default 值、

mysql 里面是  只能给timestamp类型的字段设置default值.CURRENT_TIMESTAMP。  注意datatime 类型的字段不能设置成 CURRENT_TIMESTAMP.    (不同于php的时间戳)
 

这样插入的时候就可以得到当前的时间。
sqlite  下面,请看官方文档
http://www.sqlite.org/lang_createtable.html
The DEFAULT constraint specifies a default value to use when doing an INSERT. The value may be NULL, a string constant or a number. Starting with version 3.1.0, the default value may also be one of the special case-independant keywords CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP. If the value is NULL, a string constant or number, it is literally inserted into the column whenever an INSERT statement that does not specify a value for the column is executed. If the value is CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP, then the current UTC date and/or time is inserted into the columns. For CURRENT_TIME, the format is HH:MM:SS. For CURRENT_DATE, YYYY-MM-DD. The format for CURRENT_TIMESTAMP is "YYYY-MM-DD HH:MM:SS".


相关
Attribute的基本概念
外国asp.net C#开源博客blog程序
浅析C#(.net)中的套接字socket编程
.NET 中 C#中的MD5
WPF, WPF/E释疑
.NET web service(soap)如何身份验证?
Microsoft Expression Blend 序列号sn
ado.net 连接 mysql mysql.data.dll下载
wpf(xaml)中的日历控件 Calendar
将DataGrid内容生成标准的Excel格式文件