开发者

Error in script component

HI, i am geting following error whi开发者_运维问答le laoding the data from table1(stg) to table2(std).In the script component,I am trying to find string "ABC" in perticular colulmn and replacing that string to "0.00" using c# in script component.

at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.CheckStatusAndNull(Int32 columnIndex)
at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.GetDecimal(Int32 columnIndex)
at Input0Buffer.get_Underlying2()
at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)
at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)
at UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

But the error displays here for some other column (Underlying2).Error says the column has null value. I have applied the constraints as cleanbuffer.column_isnull=true; still it shows the same error.

please help to solve the above issue.I am new to c# coding.

Thanks.


Why not do this in a derived column?

ISNULL(std)==TRUE?NULL(DT_STR,10,1252):replace(std,"ABC","0.00")

The above line says "If column std is null, then return a null, else return the string with ABC replaced by 0.00"

One thing to note. In the example I assume the string is char(10)..replace the 10 with the appropriate size.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜