Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ssis sql2005: ole db source issue

Posted on 2011-09-14
7
Medium Priority
?
378 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
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 UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

597 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