我使用 SQL Server Express 2008 并尝试将数据添加到数据类型为 datetime2(7) 的表中的字段中。
这就是我要添加的内容:
'2012-02-02 12:32:10.1234'
但我得到了错误
Msg 8152, Level 16, State 4, Line 1
String or binary data would be truncated.
The statement has been terminated.
这是否意味着添加到字段中的时间太长了?应该削减一点?如果是这样 - 你能给我一个它应该是什么样子的例子吗?
注意 - 我也尝试过这种格式:
'01/01/98 23:59:59.999'
谢谢
**编辑
实际声明:
INSERT INTO dbo.myTable
(
nbr,
id,
name,
dsc,
start_date,
end_date,
last_date,
condition,
condtion_dsc,
crte_dte,
someting,
activation_date,
denial_date,
another_date,
a_name,
prior_auth_start_date,
prior_auth_end_date,
history_cmnt,
cmnt,
source,
program,
[IC-code],
[IC-description],
another_start_date,
another_start_date,
ver_nbr,
created_by,
creation_date,
updated_by,
updated_date)
VALUES
(
26,
'a',
'sometinh',
'c',
01/01/98 23:59:59.999,
01/01/98 23:59:59.999,
01/01/98 23:59:59.999,
'as',
'asdf',
01/01/98 23:59:59.999,
'lkop',
01/01/98 23:59:59.999,
01/01/98 23:59:59.999,
01/01/98 23:59:59.999,
'a',
01/01/98 23:59:59.999,
01/01/98 23:59:59.999,
'b',
'c',
'd',
'b',
'c',
'd',
01/01/98 23:59:59.999,
01/01/98 23:59:59.999,
423,
'Monkeys',
01/01/98 23:59:59.999,
'Goats',
01/01/98 23:59:59.999
);