sql-serverexcelssisetlssis-2017

Importing Excel Data Seems to Randomly Give Null Values


Using SSIS for Visual Studio 2017 for some excel file imports.

I've created a package with several loop containers that call to specific packages to handle some files. I have an issue with one particular package being executed in that it seemingly randomly decides the data for columns is NULL per excel file. I was/am under the impression that this is part of the registry setting for TypeGuessRows (changed initially to 0 then to 1000 as a test) located at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Excel

The reason I think this is because the various files being brought in generally have the same data, but it seems that if the first few rows of columns in the source data contains only numbers, that the data with mixed values will not be brought in correctly. All other columns aside from this seems fine.

Looking at the source files, all have the same datatype. I've tried changing the registry TypeGuessRows value and ensured that the output column property was string-based instead of numerical. The connection string has IMEX=1


Solution

  • So I fixed it. Or at least found a sufficient workaround that should help anyone in my situation. I think it has to do with the cache of SSIS. I ended up putting a sort function on the problem column so the records getting read as NULL for having a random data type are read first, and not being considered random. I will say, I tried this initially and it didn't work. Through a little experiment of making a new data flow in the same package I discovered that this solution actually does work, hence me thinking the cache was the issue. If anyone has any further questions on this, let me know.