Wednesday, March 28, 2012

ODBC driver for MySQL

Hello,
I have a mysql database residing on a Linux box and a MS
SQL Server residing on a Win 2000 box. I have installed
a mysql ODBC driver that works fine with ACCESS, however
when I try to use that same Driver in SQL Server (as a
Linked server), I get errors.
For example, in Query Analyzer (or in a Stored Proc) when
I try this Select statement:
SELECT *
FROM OPENQUERY(DataMiner, 'SELECT account_type_name FROM
account_types')
I get this error:
OLE DB provider 'MSDASQL' returned an unexpected data
length for the fixed-length
column '[MSDASQL].account_type_name'. The expected data
length is 20, while the returned data length is 8.
I'm not sure why this is happening. May I be missing
something in my linked server connection? It sure seems
to work fine when hitting it from ACCESS, VB, etc..Hi:
From the error you have, I thin in the sql server field
'account_type_name', you use nchar or char which has a 20 bit, but the value
you want to give the database is 8 bit, you can changed the
'account_type_name' filed type to varchar or nvarchar and try again.
Best Wishes
Wei Ci Zhou|||yes you are right.
Diku
"Wei Ci Zhou" <weicizhou@.hotmail.com.discuss> wrote in message
news:O8Q4Txk5DHA.2736@.TK2MSFTNGP09.phx.gbl...
quote:

> Hi:
> From the error you have, I thin in the sql server field
> 'account_type_name', you use nchar or char which has a 20 bit, but the

value
quote:

> you want to give the database is 8 bit, you can changed the
> 'account_type_name' filed type to varchar or nvarchar and try again.
> Best Wishes
> Wei Ci Zhou
>

No comments:

Post a Comment