Flat File destination Ignoring decimals

  • am having a package which loads the data into flatfile and having column with currency datatype like 14.56,30.00,16.66,29.00

    when am loading data that into flatfile its coming like 14.56,30,16.66,29

    the last 2 decimals are missing when it is having no value after decimal..

    How can i achive the zeros after decimal like 29.00,13.00???

  • what kind of flat file?

    And how is your destination data type defined (text, numeric, other)?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Its a ragged right file and datatype is currency.

    when the value is 13.66 its is taking as it is...

    but when it is 0.00 in source it is taking as 0

    i think i need some derived column expression

  • Convert to text/string/varchar before dumping to that file and it will retain the .00

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Ya i have tried that But it is not working..is there any other way to do this??

  • Are you opening this file up in excel by chance?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • No am opening as text. Can u gve me sum derived column exp

  • Please can any one help me in this??

  • If you convert the data to VARCHAR in your select query, how is the formatting?

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

  • Thank you.

    It is in money datatype..i will try to convert into varchar..and let u know...

    Thank you

  • That is also not working is coming as 10,56,65.64 etc

  • i have converted into varchar but it is same as before

  • removing insignificant digits in an export is normal (3.00 is exactly the same as 3), since the assumption is, if you import "3" into a money datatype, it will be 3.0000 in the data.

    try using CONVERT(varchar,yourmoneyfield,0) to force two digits, no commas as the exported style.(note the "0"? that's the optional style to use )

    see cast and convert in BOL:

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I have tried that one..result is same like before

    Thank you

Viewing 14 posts - 1 through 13 (of 13 total)

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