dbTalk Databases Forums  

Adding NULL to SSIS Derived Column

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Adding NULL to SSIS Derived Column in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff
 
Posts: n/a

Default Adding NULL to SSIS Derived Column - 05-25-2006 , 02:47 PM






Hi,

I have a flat file that I'm sending through a derived column transform,
and into sql server. There is a column in my flat file that returns
null values. In this case, I'd like to send a NULL value to SQL server
instead.

I started making a derived column as follows:

UnitNumber == "" ? NULL(DT_STR,5) : UnitNumber

But it bombs out. Basically, if UnitNumber = "" I want to return NULL
instead of "", and if it has a value, I want to return that value.

Can someone please help me out with this?

Thanks
Jeff


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Adding NULL to SSIS Derived Column - 05-25-2006 , 02:53 PM






Hello jeff,

What happens if you check the box on the FF Source adapter that says

"Retain null values from the source as null values in the data flow task"


Does this work for you?

Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Hi,

I have a flat file that I'm sending through a derived column
transform, and into sql server. There is a column in my flat file
that returns null values. In this case, I'd like to send a NULL value
to SQL server instead.

I started making a derived column as follows:

UnitNumber == "" ? NULL(DT_STR,5) : UnitNumber

But it bombs out. Basically, if UnitNumber = "" I want to return NULL
instead of "", and if it has a value, I want to return that value.

Can someone please help me out with this?

Thanks
Jeff



Reply With Quote
  #3  
Old   
Jeff
 
Posts: n/a

Default Re: Adding NULL to SSIS Derived Column - 05-25-2006 , 03:14 PM



Hi Allan,

Yes, yes it does. Thanks a lot. My first few days moving from DTS, so
the learning curve's certainly still there.

Just for my own prosperity, is it possible to do something like I
described above?

Jeff


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Adding NULL to SSIS Derived Column - 05-25-2006 , 04:33 PM



Hello jeff,

OK So let's say you just want to put a null in the pipeline for a column
that has a length of 10

The Column starts out as being DT_STR 10


My derived column replaces this with this expression

NULL(DT_STR,10,1252)


Hope this helps


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Hi Allan,

Yes, yes it does. Thanks a lot. My first few days moving from DTS,
so the learning curve's certainly still there.

Just for my own prosperity, is it possible to do something like I
described above?

Jeff




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.