I have a table with several columns of all varchar data. We then run a SP to move the data to a new table, one of which has a datetime setting. If the varchar data is in format ddmmyyyy it get The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value when I try and do a convert insert?
Script
INSERT INTO [a].
(
[c],)
Select
CASE [Col010] WHEN null THEN null WHEN '' THEN null ELSE Convert(datetime, [Col010], 104) END,
from [c].[d]
Col010 is varchar in [a]. but datetime in [c].[d].
Any help please?
Script
INSERT INTO [a].
(
[c],)
Select
CASE [Col010] WHEN null THEN null WHEN '' THEN null ELSE Convert(datetime, [Col010], 104) END,
from [c].[d]
Col010 is varchar in [a]. but datetime in [c].[d].
Any help please?