SSIS how to convert string (DT_STR) to money (DT_CY) when source has more than 2 decimals

前端 未结 3 1092
悲&欢浪女
悲&欢浪女 2020-12-21 15:10

I have a source flat file with values such as 24.209991, but they need to load to SQL Server as type money. In the DTS (which I am converting from), that value comes across

3条回答
  •  暖寄归人
    2020-12-21 15:45

    The flat file defaults to all fields being DT_STR. Use the Advanced option on editing the connection to have the numeric field as float (DT_R4). Then, in the advanced editing of the Flat File Source (on the Data Flow tab), set that output column to money (DT_CY).

    Then, the field will convert without any additional conversions. The issue was leaving the source file definition as DT_STR.

提交回复
热议问题