SqlDbx Forum

SqlDbx

You are not logged in.

#1 2018-09-15 18:48:40

Allen
Member

Excel Import - Imprecise Values Retrieved

When you select a table, right-mouse, select "Import Data From", then select your Excel File, values imported into the INSERT script are imprecise, and are also blown out to 50+ digits.

Example:

1) Create a sample table:
        CREATE TABLE dbo.Test
            (
              Name  VARCHAR (5) NULL
            , Vaue   FLOAT NULL
            )
        GO


2) Enter these into into Excel:
        Name  Value
        ABC     .9
 
3) Import data to table.  Here is what is the scripted result:
    INSERT INTO Test (Name, VALUE)
    VALUES ('ABC', 0.90000000000000002220446049250313080847263336181640625)
    GO

4)  The imported value is imprecise.  In addition, attempts to execute the scripted INSERT statement result in error:
The number '0.90000000000000002220446049250313080847263336181640625' is out of the range for numeric representation (maximum precision 38).. Error 1007. SQLSTATE 22003. Severity 15. MsgState 1. Line 2.


Using:  SQLDbx Pro, v5.11, 32-bit
           Excel 2010, 32-bit

Thanks,
Allen

Offline

Board footer

Powered by FluxBB