ssis, conditional split DT_BOOL NULL

 Section[DT_STR]   flag(DT_BOOL)
     sec a            1
     sec b            0
     sec c            1
     sec d

I am importing data from excel sheet by using SSIS package. I have two coloumn as above and i am using data convertion to convert the data to string[DT_STR] and [DT_BOOL] I am using conditional split to split in 4 cases..

 case1-    Included section:[flag] == (DT_BOOL)"False"
 case2-    excluded section:[flag] == (DT_BOOL)"True"
 case3-    null section name:ISNULL([Section])

The 4th case is to handle the null values in the flag coloumn. how can i handle the null values in the flag coloumn?

I am trying something like [flag] == NULL(DT_BOOL) but my package fails when there is a null or a blank cell in excel sheet. How can i handle those value?

more ▼

asked Jan 17, 2012 at 01:02 PM in Default

avatar image

249 27 29 33

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

with conditional splits, the order of the cases is very important. if you put in case 4 and just do a ISNULL(Section) in the condition and then move it up to the first case, then it will work.

Just a quick note with your cases in the example, the 3rd case where section name is null will never be checked because the first 2 will take precedence over the last one. If you want the null sections to be moved somewhere else, then move it before the flag checks.

Hope this helps!

EDIT: If you want null flags to be evaluated to FALSE, you can change your data conversion transform to a derived column transform, then you don't need the ISNULL(flag) in the conditional split. Enter the Expression for the Flag as, where F2 is the column name from the spreadsheet

 ISNULL(F2) ? (DT_BOOL)"False" : (DT_BOOL)F2

alt text

more ▼

answered Jan 17, 2012 at 05:04 PM

avatar image

Daniel Ross
2.9k 11 15 18

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jan 17, 2012 at 01:02 PM

Seen: 4580 times

Last Updated: Jan 17, 2012 at 01:02 PM

Copyright 2018 Redgate Software. Privacy Policy