July 20, 2006 at 10:27 am
I have the Excel Connection Manager and Source to read the contents from an Excel file. For some reason couple of numeric fields from the Excel worksheet are brought over as nulls even though they have a value of 300 and 150. I am not sure why this is happening. I looked into the format of the fields and they are set to General in Excel, I tried setting them to numeric and that did not help.
All the other content from the excel file is coming thru except for the 2 numeric fields.
I tried to bring the contents from the excel source to a text file in csv format and for some reason the 2 numeric fields came out as blank.
Any inputs on getting this addressed will be much appreciated.
Thanks,
Manisha
July 21, 2006 at 12:28 am
Hi M_shah
You could try to change the registry entry for the driver you are using, by default it is set to 8. Make it a bigger amount like 1000. I'm using the following with in Yukon to import data to sql. ( this needs to happen on the Server not your machine ) "TypeGuessRows" is the key value you need to change
SELECT *
INTO #TempTable
FROM OPENROWSET ('Microsoft.Jet.OleDB.4.0', 'Excel 8.0;HDR=YES;IMEX=1;Database=C:\HelloWorld.xls;User ID=;Password=;','SELECT * FROM [Sheet1$A2:E10000]');
HDR = Yes just means 1st row is the header row
IMEX = 1 Is the default
Windows Registry Editor Version 5.00
*********REGISTRY STUFFF**********
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel]
"win32"="C:\\Program Files\\Microsoft Office\\OFFICE11\\msaexp30.dll"
"DisabledExtensions"="!xls"
"ImportMixedTypes"="Text"
"FirstRowHasNames"=hex:01
"AppendBlankRows"=dword:00000001
"TypeGuessRows"=dword:00000000
"win32old"="C:\\WINDOWS\\System32\\msexcl40.dll"
July 21, 2006 at 7:06 am
I've had a similar issue when importing data from excel in my asp pages. If you put a tick mark in front of the numbers in excel it will convert the number into text. You should see a little triange in the upper left corner of the cell when you add the tick mark. It should come through ok after that.
July 21, 2006 at 8:56 am
I have always found it to be easiest to import stuff from whatever file source into a temporary import table that has all the columns defined as varchar(big enough). import the data into the varchar columns, then look for anything that needs to be fixed up, like removing those tick marks before you numbers. i'll usually use a series of queries to do this kind of data fixup and looking for invalid values so i can report them. When the data is clean, then i copy it to the "real" table and convert the data types during the copy.
once the data is in the "real" table you can continue with the rest of the process that works with the information.
July 21, 2006 at 10:52 am
Hi l0n3i200n
The SQL Server 2005 install is on a 64 bit machine and I do not see
Jet under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft in the registry.
I see that entry on my local machine in the registry.
Is there some other location in the registry where the 32 bit drivers are registered at?
Thanks,
Manisha
July 25, 2006 at 7:51 am
...and if the Excel team hasn't fixed the bug with the 'guess rows' parameter you should watch out for wrong data anyway. If the Excel Import determines that one column is VARCHAR it will replace any cells containing just numerics with NULLs...
July 25, 2006 at 10:22 am
I made the change suggested with guess rows and that works on a 32 bit machine, but my Sql Server 2005 is on a 64 bit machine and there is no excel installed on that. When I run a job containing an excel datasource I specify the DTExec32.exe to run the job. In that scenario where does the guessrows parameter be set in the registry please let me know. Any inputs will be much appreciated.
Thanks,
Manisha
June 4, 2013 at 5:25 pm
On a 64 bit machine it is set here:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Excel
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply