I need to load a txt file into a sql table using SSIS. The column 'Action_date' has dates formatted like this: Feb 24 2023 9:35AM. The destination column is data type datetime. It fails with the error: Data conversion failed. The data conversion for column "Action_date" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.
I tried using the Data Conversion component but get the same result.
The job fails at the first step before it even gets to the Data Conversion.
In the Connection Manager I've tried setting the Data Type to string [DT_STR] and various Date types. How can I get this to load to something with a format like this: 2022-12-19 09:57:01.243?
TRY_CAST('Feb 24 2023 9:35AM' as datetime) results in a valid datetime value
To use TRY_CAST() you will need a Derived Column
: