Solved

excel file Import into a DB - Getting NULL Values instead of numeric data

Posted on 2009-05-18
8
906 Views
Last Modified: 2013-11-10
Hi guys,

I am trying to import excel files using FEL -- The data in the file in a particular column is preceded by apostrophe like '5758585858 for few and without an apostrophe for few ...Now the Columns without an ' are coming in as NULL Values.. How to get the original values..

I have tried changing the extended properties as below with no luck..
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ******** ";Extended Properties="Excel 8.0;IMEX=1;HDR=NO"
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ******** ";Extended Properties="Excel 8.0;IMEX=1;HDR=YES"

Plz Help
0
Comment
Question by:danny1620
8 Comments
 
LVL 14

Expert Comment

by:Emes
ID: 24415860
this is excel pickyness.  Try to make the column a varchar and see what happens.

Not sure if this is the issue or not but it may be having trouble with ints and chars.

Try to also make it one field and make it work for that.  Then expand the data slowly so you can see any problems

0
 

Author Comment

by:danny1620
ID: 24416850
I did not get you.. But @ present the column is a Varchar
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24419989
Danny,
I think I was some time ago with a similar problem... could yo attach here a sample file?
Regards,
Pedro
www.pedrocgd.blogspot.com
0
 

Author Comment

by:danny1620
ID: 24422514
Hi Pedro...
I have atached the sample file.. I am concerned about the Corrected column and the Site Column.. As you see the corrected column has values as both text and number format .... I can change the Extended properties to get either the number or Text  ...but not both

Sample.xls
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Accepted Solution

by:
danny1620 earned 0 total points
ID: 24498265
Hi

Below change in the Properties Worked for me

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ******** ";Extended Properties="Excel 8.0;IMEX=1;HDR=YES"

Thanks All
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24499077
<quote>
I have tried changing the extended properties as below with no luck..
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ******** ";Extended Properties="Excel 8.0;IMEX=1;HDR=NO"
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ******** ";Extended Properties="Excel 8.0;IMEX=1;HDR=YES"
...
Below change in the Properties Worked for me

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ******** ";Extended Properties="Excel 8.0;IMEX=1;HDR=YES"
</quote

:(
0
 

Author Comment

by:danny1620
ID: 24499906
I dont know why it did not work for the first time ... But did again..
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24502450
I knew it worked, but you had stated it did for you, that is why I saw no point in contributing.

It is covered in this article on DTS (but the same applies to SSIS):
Excel Inserts Null Values
http://www.sqldts.com/254.aspx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now