CAST DT_WSTR to Integer in SSIS

  • Hi I was trying to CAST the DT_WSTR to Integer and i was getting the error in expression Block can some one help me with my expression? Thanks in advance

    My Expression :

    (DT_I4)@V_Version >=10

    Error Message :

    TITLE: Microsoft Visual Studio

    ------------------------------

    Error at Constraint: Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_I4.

    Error at Constraint: Casting expression "@V_Version" from data type "DT_WSTR" to data type "DT_I4" failed with error code 0xC00470C2.

    ------------------------------

    BUTTONS:

    OK

    ------------------------------

  • Are you sure all values of the V_Version column can be converted to integers?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Use a data viewer and make sure that all the values of V_Version is eligible to be converted to integer 🙂

  • obviously there's a case which cannot be converted to integer, use the following query to detect the anomaly:

    Select *

    From TableName

    Where IsNumeric(ColumnName) = 0

  • i was using the below query in oracle and was storing it in variable and i tried to save it a int32 but it was not allowing me to do that ,so i was storing that variable as an object and was using the expression to compare and i was not getting the result as desired..can some one help me my expression ..thanks in advance

    My Query in Oracle database::

    Select CAST(substr(i.version,1,Instr(i.version,'.')-1) AS Numeric) AS Version from v$instance i

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply