SSIS Database Insert Issue


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.
This is what the data flow looks like:

Has anyone had this issue before?

Thanks, Greg
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
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?
spen_langAuthor Commented:
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?
spen_langAuthor Commented:
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"
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Vitor MontalvãoMSSQL Senior EngineerCommented:
In Command Prompt run the command CHCP for the codepage.
I think Sybase Native Client should comes when you install the Sybase client.
spen_langAuthor Commented:
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...
Vitor MontalvãoMSSQL Senior EngineerCommented:
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?
spen_langAuthor Commented:
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.
spen_langAuthor Commented:
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?
Vitor MontalvãoMSSQL Senior EngineerCommented:
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.
spen_langAuthor Commented:
How do I run a package as 32bit instead of 64bit?
Vitor MontalvãoMSSQL Senior EngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
spen_langAuthor Commented:
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
Vitor MontalvãoMSSQL Senior EngineerCommented:
Maybe you installed a 32bit's Sybase client. Can you check that?
spen_langAuthor Commented:
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.
Vitor MontalvãoMSSQL Senior EngineerCommented:
Wise decision :)
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 ....


spen_langAuthor Commented:
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...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.