I have a SSIS package which runs on a schedule and pulls in values from flat files. These flat files very occasionally contain negative values, however the negative symbol trails at the end of the value, e.g. 0.01020654-. When the SSIS package runs and tries to import these negative value into the table, I get the following error:
Error converting data type varchar to numeric.
The data type on the column is decimal(18, 10)
These values may not always be the same length, e.g. there may be a different number of decimal places every time. I guess I just need to move the '-' to the front of the value.
I have seen various solutions to the issue using SQL commands such as convert, should I add an extra Execute SQL Task to run this conversion, or maybe add a derived column? I'm just not sure on the best approach and would be interested to see potential solutions for this. The package runs fine 99% of the time, it's only when these negatives appear I'm getting issues.
Thanks in advance.