• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

ssis sql2005: ole db source issue

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
malraff
Asked:
malraff
1 Solution
 
MakriniCommented:
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
 
Jason Yousef, MSSr. BI  DeveloperCommented:
0
 
malraffAuthor Commented:
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Alpesh PatelAssistant ConsultantCommented:
Please change data type to DT_WSTR
0
 
Jason Yousef, MSSr. BI  DeveloperCommented:
Use no Cache and see if it works
0
 
malraffAuthor Commented:
just found issue - all of a sudden it decides it wants the stockcode field trimmed !!
0
 
Jason Yousef, MSSr. BI  DeveloperCommented:
always LTrim(RTrim())  or Trim() your columns to avoid spaces..
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now