x

ssis, conditional split DT_BOOL NULL

Section[DT_STR]   flag(DT_BOOL)
    sec a            1
    sec b            0
    sec c            1
                     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 '12 at 01:02 PM in Default

palum gravatar image

palum
249 24 29 30

(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][1]

[1]: http://ask.sqlservercentral.com//upfiles/Untitled_5.jpg
more ▼

answered Jan 17 '12 at 05:04 PM

Daniel Ross gravatar image

Daniel Ross
2.9k 10 12 13

(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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x899

asked: Jan 17 '12 at 01:02 PM

Seen: 1988 times

Last Updated: Jan 17 '12 at 01:02 PM