SSIS Expression

  • HI there can anyone enlighten me on what the following expression is doing?

    ISNULL([NU SHA Code]) ? (@[User::SHACodeFilter] == "") : (@[User::SHACodeFilter] == "") || ([NU SHA Code] == @[User::SHACodeFilter])

    Ii t checking if NU SHA Code is null. If it is set SHACodeFilter == "" but then I am unsure as to whats going on in the else bit, how can it be setting SHACodeFilter == "" OR set NU SHA Code == SHACodeFilter

    Am a little confused!

    Thanks

  • Kwisatz78 (6/24/2010)


    HI there can anyone enlighten me on what the following expression is doing?

    ISNULL([NU SHA Code]) ? (@[User::SHACodeFilter] == "") : (@[User::SHACodeFilter] == "") || ([NU SHA Code] == @[User::SHACodeFilter])

    Ii t checking if NU SHA Code is null. If it is set SHACodeFilter == "" but then I am unsure as to whats going on in the else bit, how can it be setting SHACodeFilter == "" OR set NU SHA Code == SHACodeFilter

    Am a little confused!

    Thanks

    "==" is used for comparison not for setting a value, looks strange to me.

    I read it as: -

    If the column [NU SHA Code] is null

    If variable SHACodeFilter is blank

    then If variable SHACodeFilter is blank

    or If column [NU SHA Code] = variable SHACodeFilter


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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