Home Forums Data Warehousing Integration Services How to avoid technically the null values while concatenating columns RE: How to avoid technically the null values while concatenating columns

  • sgmunson (4/25/2013)


    There may be an easier way. If the data source allows an SQL Query, and supports the ISNULL function, then your SELECT statement could look something like this:

    SELECT Field1, Field2,

    ISNULL(Field3, '') + ISNULL(Field4, '') AS CombinedFields3and4

    FROM dbo.SomeTable

    One other possiblity is if it also supports the NULLIF function:

    SELECT Field1, Field2,

    NULLIF(ISNULL(Field3, '') + ISNULL(Field4, ''), '') AS CombinedFields3and4

    FROM dbo.SomeTable

    ... which would only null the field if both sourc fields were null.

    Alternatively, there is a "Conditional" operator for SSIS that you can use in a Derived Column transformation, with a syntax something like this:

    ISNULL(Field3) ? ValueExpressionWhenTrue : ValueExpressionWhenFalse

    ... that can be used to detect a NULL value.

    ya ya your are right..By using Conditional operator only i am able to achieve my goal.but it is easily possible if i am using 2 columns but if i am used to manipulate with 4-6 columns and each column are independent ones then its become difficult to achieve it.