Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Data Wizard Does Not Like Data Type I Choose For A Column

Does anybody else have this same problem, when you import data from Excel file to MSSQL Server 2005, if some column contains mostly numeric data, but even if you set the column type to varchar, the wizard fails to import those fields that fail to parse as numbers?

like image 512
Haoest Avatar asked Apr 23 '09 00:04

Haoest


People also ask

What type of data Cannot be imported using the import Wizard?

Note: Data Import Wizard only imports Accounts, Contacts, Solutions, leads, and all the custom objects whereas Data loader imports all standard as well as custom objects.


2 Answers

Try this (Note: These instructions are based on Excel 2007)...

The following steps should force Excel to treat the column as text:

Open your spreadsheet with Excel.

Select the whole column that contains your "mostly numeric data" by clicking on the column header.

Click on the Data tab on the ribbon menu.

Select Text to Columns. This will bring up the Convert Text to Columns Wizard.

-On Step 1: Click Next

-On Step 2: Click Next

-On Step 3: Select Text and click Finish

Save your Excel sheet.

Retry the import using the SQL Server 2005 Import Data Wizard.

like image 148
Joe L. Avatar answered Nov 03 '22 01:11

Joe L.


You need to edit the connection string that SSIS uses. Add this to the end of the string "IMEX=1;" (No quotes) That tells SSIS/jet to not try and figure out what the data types are. Just import them.

like image 39
Dayton Brown Avatar answered Nov 03 '22 01:11

Dayton Brown