Converting Float to a Decimal

  • I have a CSV file that I need to import into a SQL table and I am having trouble with one of the columns. I need the data in the SQL table to be a simple decimal such as "1" or "1.5". However the source looks like this "+1.50000000000000E+000" or "+1.00000000000000E+000"

    I think these numbers are floats (although i'm no expert). In SSIS when I am creating my package, if I tell it to convert the data in that column to be a decimal, it doesn't do anything. It still gets represents as the float-type number.

    Does anyone know what data type i need to select so my values look like "1" or "1.5"?

    Thanks,

    Liam

  • .

  • CSVs have no data type defined. You define the data types in the connection manager. If you can only use float, you can convert the data type with a Data Conversion Transformation in the Data Flow Task.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

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

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