Etienne
Etienne

Reputation: 7201

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?

Upvotes: 0

Views: 613

Answers (3)

koushik veldanda
koushik veldanda

Reputation: 1107

There are 0 number of rows in the result. Our SSIS package will work row by row, if there are 0 number of rows it doesn't gets the output it just executed only.

its better to add extra column at input as null as

Select BOSP from MyTable 
UNION ALL 
select NULL 

Upvotes: 1

Nick.Mc
Nick.Mc

Reputation: 19184

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?

Upvotes: 1

Ako
Ako

Reputation: 1221

What I understand is that there is no data flowing and therefore statements in conditional split are not executed.

Next query with always return a row to examine:

SELECT MAX(column1) FROM MyTable

or

SELECT COUNT(*) FROM MyTable

Upvotes: 0

Related Questions