Testing for IsNumeric in SSIS


  • Hello,

    I have searched the forum, and have discovered that the DTS method using IsNumeric to check for numierc values (ActiveX) is not valid in SSIS. Most of what I have seen prescribes using the script component to handle this.


    So formerly, I checked to see if a column was numeric. If it was, then I needed to use the numeric value as is, or in some cases, I needed to perform a calculation on the value and use the result. If the value was not numeric, then whatever the value was needed to be changed to zero.


    Here is an example of how I would use the current value, or set the value to zero:


    If IsNumeric(DTSSource("Col003")) Then DTSDestination("ADepTrnx") = CLng(DTSSource("Col003")) Else DTSDestination("ADepTrnx") = 0 End If


    This is an example of how I would use the current value in a calculation, or set the value to zero:


    If IsNumeric(DTSSource("Col012")) Then DTSDestination("AlliStdFee") = CLng(DTSSource("Col012"))/100 Else DTSDestination("AlliStdFee") = 0 End If


    Does anyone have an example of how I would handle both situations in a script component?


    Thank you for your help!





    Tuesday, December 18, 2007 8:19 PM

All replies