Search code examples
ssisconditional-statementsisnullssis-2012

SSIS Conditional Split - No value return


I am using SSIS 2012

My statement:

Select BOSP from MyTable

Result is not NULL, it returns nothing as seen below.

enter image description here

Problem now is in SSIS if the result is NOTHING like above I need to do something using the Conditional Split, but if there is data then I need to do something else. But using the ISNULL() wont work because there is no NULL.

enter image description here

Is there a condition I can used?


Solution

  • Explain what do you want to do in a conditional split if there are no rows? If you want to process just one row, fine, but if you want to do some conditional processing then the conditional split is the wrong element to use.

    For example this will give you a dummy NULL row if there are no rows in the table:

    Select BOSP from MyTable 
    UNION ALL 
    select NULL 
    where not exists 
        (select 1 from MyTable) 
    

    But now how do you know if that's a real row or not?