SolvedPrivate

Using Derived Column Transformation Editor to populate 0 if the incoming value is null

Posted on 2014-09-12
4
26 Views
Last Modified: 2016-02-13
i have the expression. I know this is a form for text type fields. i have a numeric field. IS this not the right syntax ?

ISNULL([_per_aban]) 0: [_per_aban]
0
Comment
Question by:basile
  • 2
4 Comments
 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 250 total points
ID: 40319608
ISNULL ( check_expression , replacement_value )

ISNULL( [_per_aban] , 0 )

see: http://msdn.microsoft.com/en-us/library/ms184325.aspx

{+edit} That's for TSQL
are you asking for SSIS?
0
 
LVL 1

Author Comment

by:basile
ID: 40319716
yes, i'm talking about SSIS. the transformation editor
0
 
LVL 1

Author Comment

by:basile
ID: 40319825
wha't i'm trying to do, is read a .csv file. If the value is null, just replace with 0.

the incoming value is null, which causes problems getting into a numeric column (even though i allow nulls). I'm using this without error:

ISNULL(SL) ? 0 : (DT_NUMERIC,18,0)SL --On the fly conversion from string to numeric

however, when I run the package, i get the below error

[Derived Column [2719]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "component "Derived Column" (2719)" failed because error code 0xC0049063 occurred, and the error row disposition on "output column "_SL" (2791)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
0
 
LVL 21

Accepted Solution

by:
Alpesh Patel earned 250 total points
ID: 40336383
In Derived column

Create nwe Column and write expression.


 (DT_NUMERIC,18,0)(ISNULL([IncomingColumn]) ? 0 : [IncomingColumn])
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now