【发布时间】:2015-10-05 13:01:06
【问题描述】:
为什么当我尝试将此字符串插入 SQL Server 数据库表的“日期时间”列时,会出现代码为 242 的错误消息:
'2012-11-16 00:00:00.000'
报错信息如下:
Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data
type resulted in an out-of-range datetime value.
如果我尝试插入此值,则不会出现此错误:
'2012-11-16 15:00:00.000'
【问题讨论】:
-
CONVERT(DATETIME, '2012-11-16 00:00:00.000') 不起作用!
-
插入表值 ('CONVERT(DATETIME, '2012-11-16 00:00:00.000') 不起作用...
-
你怎么能这样插入改变数据类型或声明表变量中的语句插入
-
insert into Table values ('2012-11-15 20:51:59.998') 也不起作用,但是为什么。
标签: sql sql-server datetime