Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
PanzerAttack
Yak Posting Veteran
71 Posts |
Posted - 2011-09-06 : 08:12:07
|
I have this REPLACE(DisputeCaseReasonCode,"NULL","ZXX")in a Derived field in the SSIS package. Some of the DisputeCaseReasonCode are coming through blank, and where this is happening, I want to assign the code ZXX.Have I done something wrong as it's not updating the field. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-06 : 08:15:43
|
it should be COALESCE(NULLIF(DisputeCaseReasonCode,''),'ZXX')------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
PanzerAttack
Yak Posting Veteran
71 Posts |
Posted - 2011-09-06 : 08:23:18
|
Thanks for the very quick response, I get an error I'm afraid:Error at Data Flow Task [Import Date Derived 1 1 1 1 1 [17]]: Parsing the expression "COALESCE(NULLIF(DisputeCaseReasonCode,''),'ZXX')" failed. The single quotation mark at line number "1", character number "39", was not expected.Error at Data Flow Task [Import Date Derived 1 1 1 1 1 [17]]: Cannot parse the expression "COALESCE(NULLIF(DisputeCaseReasonCode,''),'ZXX')". The expression was not valid, or there is an out-of-memory error.Error at Data Flow Task [Import Date Derived 1 1 1 1 1 [17]]: The expression "COALESCE(NULLIF(DisputeCaseReasonCode,''),'ZXX')" on "output column "DisputeCaseReasonCode1" (167)" is not valid.Error at Data Flow Task [Import Date Derived 1 1 1 1 1 [17]]: Failed to set property "Expression" on "output column "DisputeCaseReasonCode1" (167)". (Microsoft Visual Studio) |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-06 : 08:37:09
|
ok so you're doing this in ssis derived column. you could have specified that.if thats the case try(ISNULL(DisputeCaseReasonCode) || DisputeCaseReasonCode=="")? (DT_WSTR,100)"ZXX" : DisputeCaseReasonCode------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
PanzerAttack
Yak Posting Veteran
71 Posts |
Posted - 2011-09-06 : 09:17:16
|
It worked perfectly, thank you |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-06 : 11:09:13
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|