Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

SSIS Database Insert Issue

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
spen_lang
Asked:
spen_lang
  • 9
  • 7
1 Solution
 
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?
0
 
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?
0
 
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"
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
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.
0
 
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...
0
 
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?
0
 
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.
0
 
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?
0
 
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.
0
 
spen_langAuthor Commented:
How do I run a package as 32bit instead of 64bit?
0
 
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
0
 
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
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Maybe you installed a 32bit's Sybase client. Can you check that?
0
 
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.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Wise decision :)
0
 
DcpKingCommented:
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
 
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...
0

Featured Post

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.

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