7783
7783

Reputation: 373

SSIS (SQL Server 2008)

In SSIS, I want to use conditional split which is to filter Country ="USA".This works fine and it filters the table.But now i want to decode "USA" to "United States Of America" in resultant OLE DB Destination.Where can i give the condition.

Upvotes: 1

Views: 946

Answers (1)

billinkc
billinkc

Reputation: 61269

Option 1

If you only have 1 or 2 values to decode, add a Derived Column Transformation and use logic like County=="USA"? "United States of America" : "Unknown" Embedding more than 2 ternary operators ?: can make for a readability and thus a maintenance nightmare

Option 2

Use a Lookup Transformation to provide your translations. If you don't have a real mapping table, just create a derived one like

SELECT D.Country, D.Name
FROM
(
    SELECT 'USA', 'United States of America'
    UNION ALL SELECT 'CAN', 'Canada'
    UNION ALL SELECT 'ROU', 'Romania'
) D (Country, Name)

And then map the Country to Country and select the Name

Option 3

Use a script task to perform the same translation except I'd use something like a SortedDictionary from System.Colllections.Generic.SortedDictionary<string,string> for the lookups.

Upvotes: 1

Related Questions