February 12, 2016 at 3:40 am
hi
i am import an Excel to a SQL Server ( using DB>TASKS>IMPORT DTA ...) and so on
i am creating an NEW table called 'aaa' from the Excel
the problem is that the data in one column in the original Excel has the following type
3461196008
3461196017
0100035.2
0100036.2
tha datatype of the specific column (table aaa) is float
the problem is when i am trying to see the data in SQL Server ( select * from aaa)
where tha data have the "0100035.2" is all of them null
i tried to change the datatype but the problem remaining , i cannot see the "0100035.2"
i will appreciate any help
thanks
February 12, 2016 at 4:44 am
I would suggest you don't load the data into a float datatype unless you're sure that's what you want. Best to use a high precision numeric.
In the import wizard, I think you can intervene on the sql which is used for the create table. Otherwise tweak your table manually and then point to it during the import.
make sure your datatype makes sense. It looks like numeric data, but what is with the leading zeroes? Also if you're searching for numerical data, then don't put it in quotes.
February 12, 2016 at 6:04 am
You may have to format the Excel worksheet before loading it. If the column in question is formatted as General, you'll need to change the entire column's data type to get it to load properly.
Because ... Excel .... SUCKS ... that way. :pinch:
February 12, 2016 at 9:02 pm
If you want to preserve the presence of leading zeros, don't import the data as any form of numeric. Import it as some form of string.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 13, 2016 at 7:49 am
Brandie Tarvin (2/12/2016)
Because ... Excel .... SUCKS ... that way. :pinch:
I would say it as "because integrating with Excel sucks that way." It is not technically Excel that sucks, it is the driver, now ACE. The JET drivers also sucked in this way. Excel is just a (mostly) innocent data source. The driver is the thing that scans the number or rows before making a semi-educated guess at tbe data types per the driver's TypeGuessRows setting.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
February 13, 2016 at 7:52 am
georgheretis (2/12/2016)
hii am import an Excel to a SQL Server ( using DB>TASKS>IMPORT DTA ...) and so on
i am creating an NEW table called 'aaa' from the Excel
the problem is that the data in one column in the original Excel has the following type
3461196008
3461196017
0100035.2
0100036.2
tha datatype of the specific column (table aaa) is float
the problem is when i am trying to see the data in SQL Server ( select * from aaa)
where tha data have the "0100035.2" is all of them null
i tried to change the datatype but the problem remaining , i cannot see the "0100035.2"
i will appreciate any help
thanks
Try adding IMEX=1 to the extended properties of your Excel connection string and redefine your initial staging table where all columns character types (N/VARCHAR).
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
February 24, 2016 at 7:34 am
Orlando Colamatteo (2/13/2016)
Brandie Tarvin (2/12/2016)
Because ... Excel .... SUCKS ... that way. :pinch:I would say it as "because integrating with Excel sucks that way." It is not technically Excel that sucks, it is the driver, now ACE. The JET drivers also sucked in this way. Excel is just a (mostly) innocent data source. The driver is the thing that scans the number or rows before making a semi-educated guess at tbe data types per the driver's TypeGuessRows setting.
Point taken.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply