Converting Varchar to smallint

  • I am trying to convert Varchar(5) to smallint,

    I tried in both Derived Column transformation and Data conversion transformations using Typecast function with (DT_14).(showing in Red color)

    I am getting 3 types of errors:

    1. Cannot parse the expression "(DT_14)" . The expression was not valid or out of memory.

    2. The expression "(DT_14)" on input Column is not valid.

    3. Failed to set expression on input column.

    Can anyone resolve it?

  • What is (DT_14) ? Are you trying to convert to an integer? If so, you should be using (DT_i4). Note that is a letter, not a number. I've put it in lower case to make it more clear, although it should be capitalized.

  • (DT_i4) returns a 4 bytes integer. If you need a smallint, you should use (DT_i2) instead

  • I always find this link (especially the chart at the bottom) useful for matching up sql server data types to SSIS data types

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

    G

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

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