Link to home
Create AccountLog in
Microsoft Excel

Microsoft Excel

--

Questions

--

Followers

Top Experts

Avatar of VDanner
VDanner

SSIS Importing Excel Column Numeric String
I am using SSIS to import a monthly Excel file of product sales data.  One of the columns in Excel is a numeric string containing product number.  Sometimes this number begins with a zero, so I need it to be interpreted as text.  When I receive the file, a few of the rows have an empty product number so I need to type it in.  I notice that when I import this thru SSIS these values come over as NULL.  I've tried a few things on the Excel file side before importing, to no avail, such as changing the Format Cells in Excel for the column to Text (as opposed to General).  I also tried creating a new column, formatting it as Text, then copying the original column of product number values into that new column and using that for the import.  On the SSIS side, I have used an Image View to see at what point the values are getting put to NULL, and it is in the very first step, that being the Data Flow Component extracting from the Excel Source.  In the Advanced Editor of that step, the column is set to type DT_WSTR (255) for both External Columns and Output Columns.  It won't seem to allow anything other than that.  I'm thinking the solution has to be in how I am preparing the data on the Excel side, but not sure what to try.  It is only the rows that I manually add in a product number that are causing me an issue.

I've attached a copy of the Excel file, and highlighted those I've typed in manually and which are coming over as NULL.  I've also attached a screen print of the Excel step in SSIS in case that helps.

By the way, I have a very similar issue with another import when I'm bringing over zip code data.
ProductSales.xls
SSIS.jpg

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of barry houdinibarry houdini🇬🇧

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of VDannerVDanner

ASKER

You know what - I think I tried that as well but forgot to mention it.  In any case, it had failed when I did that.  However, trying your approach confirmed for me that this is the way to do it.  After doing that, it failed but I finally realized the data they sent me had one duplicate record and the offending record was one of the ones that I "fixed" using your suggestion.  So applying your approach and deleting that offending duplicate prior to running SSIS did the trick.  Thank you so much - this should help confirm for me how to handle another package I use for zip codes, at least I hope so.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Microsoft Excel

Microsoft Excel

--

Questions

--

Followers

Top Experts

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.