Solved

ssis sql2005: ole db source issue

Posted on 2011-09-14
7
359 Views
Last Modified: 2013-11-10
hi all

i have an ole db source in an ssis package which is connected to an excel document.
all seemed to be working fine until i noticed that i was getting random null values for my stock codes in the sql table destination!
now as far as i can see the issue resides with stock codes which have letters..

i have tried changing the stock code column data type to string, unicode string etc to no avail

anyone any ideas?
0
Comment
Question by:malraff
7 Comments
 
LVL 10

Accepted Solution

by:
Makrini earned 500 total points
ID: 36535038
It's because Excel uses the first 8 lines to determine the data type, and ignores anything that doesn't fit..

i.e in your first 8 rows of data, the majority of your stock codes are numeric only, so when the Jet driver queries it, it blanks out text values as Null.


You can work around it by making sure that the first 8 rows of data are in the format you want.  If often make the first 8 garbage - you could have stock code "a" - then filter out that stock code when you get it up to the SSIS package
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36535667
0
 

Author Comment

by:malraff
ID: 36536251
i changed the excel column type to text and it seems to work fine

now all of a sudden a lookup i am doing is retrieving no information ! it was working fine!
dosnt matter if  i change the stockcode type back to general - it simply returns nothing

very strange behavior
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 36536262
Please change data type to DT_WSTR
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36536272
Use no Cache and see if it works
0
 

Author Comment

by:malraff
ID: 36536365
just found issue - all of a sudden it decides it wants the stockcode field trimmed !!
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36536557
always LTrim(RTrim())  or Trim() your columns to avoid spaces..
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

863 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

23 Experts available now in Live!

Get 1:1 Help Now