Extract Issue (".0" added to values)

  • I'm extracting columns from a CSV file.

    One column, in the CSV file, has a format of general and is only populated by numbers (0 - 126); no decimal places.

    During the extract, the column is copied into my staging table as an NVARCHAR value. However, after the extract, the values have all been appended with a ".0". What could be causing this?

    Thanks!

  • Because of implicit conversions.

    A better question would be...

    ... why are you copying INT data into an NVARCHAR column to begin with?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Not sure. I inherited this package. I suppose I can just change it to INT in the destination table.

    HOWEVER, when I try to import this file via the Import/Export Wizard and I preview the data, the values are still appended with ".0". Very frustrating...

  • Previews lie... not sure I'd take 100% stock in the preview any more than the trust I put in an estimated execution plan (which I don't trust at all 😉 ).

    Try the real thing on a smaller set of data and see what happens... you might be pleasantly surprised... or not... that's the purpose of the small test.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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