Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Restricting number of decimals in flat file export

$
0
0

Hi,

I have an SSIS package which gets its data from a query executed on the database. I need to load this data into a flat file. I am using ragged right export, so my destination has fixed length fields. 

Now I have a float field named "Amount" in the source which has to be restricted to the format 000000000.00. I get Amount in this format by using CAST(Amount AS DECIMAL(11,2)) in the query. But when this data is loaded into the flat file it is loading a number of digits after the decimal like for example instead of 3383626.63 it is displaying 3383626.6299999999. Since my destination file has fixed length field this is resulting in an error.

The error description is this - "[Flat File Destination [1178]] Error: Data conversion failed. The data conversion for column "Amount" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". 

Please help me with this issue.

 


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>