Flatfileimport via SSIS - Conversion

Nelly 1 Reputation point
2021-02-05T06:05:48.123+00:00

Hello - I'm quite new to all of this. I am importing a Flatfile (csv) via SSIS Project. The problem is, that I can't convert the columns. If I import the whole files as dt_str and do a cast via query it works - but I need the data to be converted when importet and not later on.

Any ideas how I could make this possible? Here is an example:

in the Sourcefile I have the column orderamount looking like this:
9.0
-9.0
6.0
-55.0
I added a converion task to the Dataflow : (dt_numeric,8,2)[orderamount]

but it doens't work, the system tells me it is unable to convert it.

Furthermore I have a column in the sourcefield which contains dates, nulls an empty fields. In a Query I can handle the data like this:
CASE WHEN NULLIF (Deliverydate, 'NULL') IS NOT NULL THEN CONVERT(Date, Deliverydate, 104)
ELSE CAST('04/01/2021' AS DATE) END AS Deliverydate

but I do not know how to say the same thing in an expression.

Thanks for helping me out!!

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalv-MSFT 5,926 Reputation points
    2021-02-05T07:49:47.15+00:00

    Hi @Nelly ,

    Please add error flow redirection in ssis data flow task.

    We can refer to the following link and pictures:

    Using the SSIS Error Output On the Data Flow

    64471-dataconversion.png

    64472-configureerroroutput.png

    64474-df.png

    Best Regards,
    Mona

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.