SQL 2012 Import from Excel fails when blank

I was given a spreadsheet with item numbers and alternate item numbers. There are about 800 rows in the spreadsheet and it looks like this:


I am just clicking Tasks->Import inside SSMS. ALTITEM1 and ALTITEM2 import fine because no rows are missing any values and they correctly came over as nvarchar(255) as all columns are defined as text in Excel. However, ALTITEM3 and ALTITEM4 for same strange reason get converted to float even if I tell SSMS to treat them as nvarchar. How do I prevent this conversion? If I do tell it to use nvarchar the import does not work at all because it tells me invalid conversion. If I do not tell it to convert them all the values come over as NULL.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott PletcherSenior DBACommented:
You could try to fix all that.

Or you try a quick work-around.  Add a dummy first row to the spreadsheet and put a string of 50 x's (xxxxxxx...) in the columns that are now being treated as float.  That should force Excel to treat them as (n)varchar.  Then, after you load the spreadsheet into SQL, delete that row.
rwheeler23Author Commented:
That is what I tried and that failed. I even tried inserting a bunch of rows with X's.  Isn't there a setting where you can tell it to read some many records as it tries to determine the column type? The only fix I had for now was to create 2 additional spreadsheets and in each column eliminated all blanks.
Scott PletcherSenior DBACommented:
Supposedly there is a registry setting to control the number of rows, but I've never been able to get it work consistently.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rwheeler23Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.