我需要幫助來確定導致問題的原因。插入表格轉換失敗
create table ##temp
(
city Varchar(100),
country Varchar(100),
region Varchar(30),
load_date datetime
);
insert into ##temp
select
a.city,
a.country,
'' as region,
a.load_date
from
table_1 a
錯誤:
Conversion failed when converting date and/or time from character string.
負載日期例如:
2017-04-17 00:00:00.000
2017-04-17 00:00:00.000
2017-04-17 00:00:00.000
2017-04-17 00:00:00.000
2017-04-17 00:00:00.000
您正在使用什麼數據庫管理系統使用
CAST
和CONVERT
?請相應地添加標籤。 – Alfabravo你能舉一些例子數據嗎? – AlwaysData
你可以嘗試用簡單的插入語句插入一行到表中嗎?然後在這裏提供插入語句,所以也許有人可以看到爲什麼插入失敗。 – AlwaysData