Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Informix ODBC nchar --> cast as varchar?


Informix ODBC nchar --> cast as varchar?

Author
Message
Henk de W
Henk de W
SSC Rookie
SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)

Group: General Forum Members
Points: 49 Visits: 629
I need to copy more than a 100 large tables on a daily basis from Informix to SQL Server.
It seems like that on the Informix side most fields are nchar. With a few exceptions these are implicitly casted as varchar on the SQL Server side (that's how the data is stored). We use linked server/openquery.

The copying takes forever even though we managed to improve the performance by a factor 20 or so.

Now what I was considering was to Cast the nchar columns to varchar in the openquery statement, so make Informix doing the explicit conversion and resulting in a higher effective throughput (based on the thought varchar consumes less space than nchar).

The linked in Server is making use of a ODBC connection.


I thought the syntax has to be something like:
...SELECT * FROM OPENQUERY(xxx, 'Select ...CAST([invoice_no] AS VARCHAR(50)) invoice_no... from xxx.invoice')


where invoice_no is nchar(50)

Problem is that I cannot access the system at the moment so I cannot test this out myself.

Does it make any sense what I'm doing? Would this actually result in a better performance?
Is the syntax correct?

Henk
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search