I have a holding table with imported data from an external source. All columns are set to Varchar(50). When I try and run a script that takes this data and populates the correct table I get "conversion failed when converting to datetime error" data in Varchar field reads 22/11/2008 00:00:00 (just one of over a million different dates) and the column in correct table set to datetime. server is sql 2005 and script looks like this...
insert into xxxx
(testtable)
select
--data
CASE [Column 6] WHEN null THEN null WHEN '' THEN null ELSE Convert(datetime, [Column 6], 104) END,
from upload
insert into xxxx
(testtable)
select
--data
CASE [Column 6] WHEN null THEN null WHEN '' THEN null ELSE Convert(datetime, [Column 6], 104) END,
from upload