transform as ssis reads

  • I have a requirement which is something like this:

    table A

    Name Country State Zip

    Anna USA VA 22222

    Banu Canada ON 33333

    now first thing I need to do is set country = Local if country = USA .. how can do that while reading the table? I know I can do an update statement once the data has been loaded.. can I do this while SSIS is reading and loading the table?

  • Sure you can. You'll have to use SQL Command as you data access mode in your data source configuration, and use the REPLACE function in your SQL code that you are using to retrieve data from the table.

    Based on your table A, this will work just fine

    SELECT A.Name,

    REPLACE(A.Country, 'USA', 'Local') as Country,

    A.State,

    A.Zip

    FROM table A A;

    I hope this helps.

    Cheers!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply