Hello,
I'm using SSIS, SQL Server 2012 and Visual Studio 2010.
I'm trying to retrieve data from Excel source - it can contain both numbers and strings (like 'x' for an unknown number). I'd like to read it all and save to database into NVARCHAR(MAX) columns. Later, I will move all the correct numbers to my data warehouse and store it in DECIMAL(18,4) columns.
Unfortunately, I have noticed that SSIS converts numbers like 11010.61 to 11010.610000..001.
I tried to ignore the problem and convert those numbers into DECIMAL(18,4) while transferring them to data warehouse. But sometimes 0 is converted to -2.9999999999999999E-2 what makes casting impossible.
I added "IMEX=1" to the connection string in the excel source and now when SSIS discovers any string in the first eight rows, it will read all the cells as strings - so the numbers will be retrieved correctly. But when there's no string in the column, the numbers are converted into this strange format. Below I've attached a screenshot to show what it looks like.
What can be the reason of this behavior? In my excel source's advanced editor both External and Output Columns' DataType property is set to "Unicode string [DT_WSTR]". In the excel file, all the cells have "General" format. On the preview in the excel source the data looks fine - but when I turned on Data Viewer on the data flow path that goes from this excel source, I've noticed that it's already converted to this format. So there must be something wrong with retrieving data from the source - but I haven't manager to find out what could be wrong.
Thank you in advance!