Groups | Blog | Home
all groups > sql server odbc > january 2004 >

sql server odbc : ODBC driver for MySQL



Cary Lewis
1/28/2004 4:10:37 PM
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..
Diku
1/29/2004 4:34:24 PM
yes you are right.

Diku
[quoted text, click to view]

Wei Ci Zhou
1/29/2004 5:43:16 PM
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

anonymous NO[at]SPAM discussions.microsoft.com
1/30/2004 12:21:24 PM

[quoted text, click to view]
change the size of the field in MySQL. It's a character
field and it varies. What I ultimately was trying to do
was view the data of the MySQL Database using MSSQL's
Enterprise Manager. But I found out that this is not
AddThis Social Bookmark Button