There is no such thing as a NULL cell in Excel. An empty cell in Excel is simply an empty string. Excel doesn't actually understand types at all. Everything is a string. What you're referring to as a "type" in Excel is just the formatting that is applied to a column/cell for display purposes and has no bearing on the actual string value. When SSIS imports the data is sees everything as strings. To make the import a little easier it tries to figure out what the actual type is by heuristics. If it cannot figure it out then it just assumes string. Based upon this document it currently uses the first 8 rows. If you have mismatched data then it won't be able to figure things out. Therefore the recommendation is to modify the Extended Properties
to include IMEX=1
which tells the provider not to bother and everything gets imported as a string. You would then add a data transformation step to convert the textual values to the actual types you need using the standard SSIS tools. It is at this point you'd also be able to do conditional things like change empty text values to a default value if you wanted.
Null values in dates - unable to read from ssis
Hi Expert,
I am importing dates from excel to SSIS to load data but some values are null in dates so ssis unable to read it as date and reading as nchar
SSIS reading as number or nchar
have another date dimension where there is no null data and reading properly
expected results as below.Please suggest . I heard about ime=1 but do not know how to import it
7 answers
Sort by: Most helpful
-
Michael Taylor 54,321 Reputation points
2022-03-30T20:28:32.777+00:00 -
Shambhu Rai 1,411 Reputation points
2022-03-30T20:51:32.803+00:00 can not find this option in ssis
Extended Properties to include IMEX=1 -
Shambhu Rai 1,411 Reputation points
2022-03-30T21:15:40.567+00:00 ALSO tried this syntax in connectionstring
" Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Source1.xlsx;Extended Properties="EXCEL 12 HDR=YES;IMEX = 1 ;MAXSCANROWS = 15;READONLY = FALSE";" -
Shambhu Rai 1,411 Reputation points
2022-03-30T21:45:54.047+00:00 added
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Source1.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES;IMEX=1";
again error
-
Shambhu Rai 1,411 Reputation points
2022-03-30T22:23:09.537+00:00 I have changed the format in excel sheet to date and it works... getting error in converting nWSTR TO Integer gives as error using data conversion function
while converting column "No 1" (38) to column "Copy of P#O No 1" (6). The conversion returned status value 2 and status text