Solved

SSIS Database Insert Issue

Posted on 2014-09-24
17
191 Views
Last Modified: 2016-02-10
Hi,

I have a simple SSIS package that selects data from a Sybase database table and then populates the data into a different table in the same Sybase database.

I am using an OLEDB source and target.

When I run the package from my development PC it runs perfectly and inserts the data. When I run the package from my production server (SQL Server 2008) it completes successfully and inserts all the required records BUT the string fields are inserted with blank spaces to fill up the column.

For example column "Depot" is set as datatype CHAR(4) - I also tried VARCHAR(4)

> development PC inserts the depot as "BWL"
> production server inserts the depot as "BWL " with a space to make up 4 characters

I am using the same sybase database and table for development and production tests.

When I opened the package on my production server I had to change the source and target OLEDB setting "AlwaysUseDefaultCodePage" to True, whereas the package worked fine on the development PC with a value of False. If I leave this setting as False on the production server I get the following warning.
Warning.JPG
This is what the data flow looks like:

Data-Flow.JPG
Has anyone had this issue before?

Thanks, Greg
0
Comment
Question by:spen_lang
  • 9
  • 7
17 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Instead of OLEDB, can you use Sybase Native Client?
About the CodePage, did you check if your PC and the Server has the same CodePage?
0
 

Author Comment

by:spen_lang
Comment Utility
How do I check the CodePage?

The only option I have in SSIS Data flow is ADO NET Source or OLE DB Source, where can I find the Sybase Native CLient?
0
 

Author Comment

by:spen_lang
Comment Utility
I am using OLE DB instead of ADO NET as I needed to pass parameters to the query and therefore I am using a "SQL command from variable"
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
In Command Prompt run the command CHCP for the codepage.
I think Sybase Native Client should comes when you install the Sybase client.
0
 

Author Comment

by:spen_lang
Comment Utility
Both server have an active code page of 850. The package default code page is 1252.

I have changed the provider of the data source to "Native OLE DB\SQL Anywhere OLE DB Provider 11" rather than ODBC but I still have the same issue...
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
I don't think the code page have something to do with it. Should be something that differs from both machines.
The normal behavior is that spaces are used to fill a CHAR() column. The columns has exactly the same datatypes at source and destination tables?
0
 

Author Comment

by:spen_lang
Comment Utility
The source is a stored procedure. I have changed the target table to varchar(4) but I get the same problem. This was originally set to varchar(4) then changed to char(4) to see if it made a difference...

Very strange issue.
0
 

Author Comment

by:spen_lang
Comment Utility
It must be a problem with the 64-bit driver installed on the production server for sybase anywhere. If i change the project debug option run64bitruntime to false then the insert is correctly performed without blank spaces. Can I run the package as 32bit although the server ssis installed on is 64bit?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Really strange behavior.
I don't see why you can't run the package as 32bit. It's allowed and you already saw that works.
0
 

Author Comment

by:spen_lang
Comment Utility
How do I run a package as 32bit instead of 64bit?
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
Comment Utility
You need to run it with the 32 bit executable:

DTExec 32-Bit  should be in C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn
DTExec 64-Bit  should be in C:\Program Files\Microsoft SQL Server\90\DTS\Binn
0
 

Author Comment

by:spen_lang
Comment Utility
OK so the problem exists somewhere with the 64bit driver and I do not know how to fix this so i am forcing the package to run as 32bit as this works.

thanks for all your help with this.

32 bit setting
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Maybe you installed a 32bit's Sybase client. Can you check that?
0
 

Author Comment

by:spen_lang
Comment Utility
Both 32bit and 64bit drivers are installed on the server. A third party company installed these drivers for us and it is working OK with SSRS so don't want to make changes without knowing what I am doing. I have contacted the third party company to have a look.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Wise decision :)
0
 
LVL 16

Expert Comment

by:DcpKing
Comment Utility
If you use char type then that's expected behaviour. If varchar then you may have encountered a bug. If you haven't managed to get rid of it I'd suggest that the easiest way to proceed would be to run an Execute SQL task to trim the spaces after filling the fields with data ....

hth

Mike
0
 

Author Comment

by:spen_lang
Comment Utility
The datatype is varchar, I was thinking along the same point of creating an sql task at the end. But then I found out that I could force the package to run using the 32bit driver, which does not have the bug...
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

10 Experts available now in Live!

Get 1:1 Help Now