I'm trying to do what should be the simplest of things but I'm banging my head against the wall.
I have a flat file with fixed width (8) date as yyyymmdd. I want to import this into a table with smalldatetime data type. I would have thought as its yyyymmdd I could just map it and it would be read in correctly but I get the following errors.
"Invalid character value for cast specification".
"The value could not be converted because of a potential loss of data."
I had set up column in the flat file connection manager as string [DT_STR] output length(8). So I have tried changing this to all the available date types with no joy. I have also tried adding a derived column task and casting the field to all the different date types, still no joy.
There are no duff characters or blanks in the flat file. If I import the data into a varchar(8) column I can then convert that column to smalldatetime without any error. All the dates are read correctly.
Help would be appreciated.
I have a flat file with fixed width (8) date as yyyymmdd. I want to import this into a table with smalldatetime data type. I would have thought as its yyyymmdd I could just map it and it would be read in correctly but I get the following errors.
"Invalid character value for cast specification".
"The value could not be converted because of a potential loss of data."
I had set up column in the flat file connection manager as string [DT_STR] output length(8). So I have tried changing this to all the available date types with no joy. I have also tried adding a derived column task and casting the field to all the different date types, still no joy.
There are no duff characters or blanks in the flat file. If I import the data into a varchar(8) column I can then convert that column to smalldatetime without any error. All the dates are read correctly.
Help would be appreciated.