Suitable Data Type for Decimal in SSIS

jn93 671 Reputation points
2022-11-22T09:11:30.647+00:00

Hi All,

I have SSIS package export from SQL table into CSV file. After export, as shown below some of the data in CSV file is not same as per SQL table. Upon checking the data type in output column EXCESS at advanced editor of source, it is in NUMERIC. Any suitable data type to ensure I got the same in CSV?

262955-image.png

SQL Server Integration Services
{count} votes

Answer accepted by question author
  1. Yitzhak Khabinsky 27,091 Reputation points
    2022-11-22T13:38:18.497+00:00

    Hi @jn93 ,

    You can use a Derived Column Transformation for your goal.
    Please try the following expression:

    Excess < 1 ? "0" + (DT_WSTR,6)Excess  : (DT_WSTR,6)Excess  
    

1 additional answer

Sort by: Most helpful
  1. ZoeHui-MSFT 41,536 Reputation points
    2022-11-23T01:42:32.873+00:00

    Hi @jn93 ,

    Like YitzhakKhabinsky-0887 said that you may use a Derived Column to change the format of the value.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.