?
Solved

ssis sql2005: ole db source issue

Posted on 2011-09-14
7
Medium Priority
?
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 10

Accepted Solution

by:
Makrini earned 2000 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

765 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