Hi Madhu,
The Excel driver reads a certain number of rows (by default, 8 rows) in the specified source to guess at the data type of each column. When a column appears to contain mixed data types, especially numeric data mixed with text data, the driver
decides in favor of the majority data type, and returns null values for cells that contain data of the other type. So you can get the first 700 rows with Numeric data type, the last 39 rows wit NULL values.
To fix this issue, we can modify this behavior of the Excel driver by specifying Import Mode. To specify Import Mode, add
IMEX=1 to the value of Extended Properties in the connection string of the Excel connection manager in the
Properties window. Because the IMEX=1 extended property for Excel connection string is used when there are mixed data types in one column.
Then please also change the value of the TypeGuessRows registry key so that Excel driver scans more than 8 rows (by default) to find the data types. Because
the driver by default looks at the first eight rows and from that sampling determines the datatype. So please change the key as below:
- If the source Excel file is .xls file, the provider used will be Microsoft JET OLE DB 4.0. In this case, we need to modify the following registry key from 8 to 0:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel\TypeGuessRows - If the source Excel file is .xlsx file, the provider used will be Microsoft ACE OLE DB 12.0. In this case, we need to modify the proper registry key according to the Office Excel version:
Excel 2007: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\12.0\Access Connectivity Engine\Engines\Excel\TypeGuessRows
Excel 2010: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Excel\TypeGuessRows
Excel 2013: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\15.0\Access Connectivity Engine\Engines\Excel\TypeGuessRows
Reference:
Excel Source
Thanks,
Katherine Xiong