Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello all, I hope someone here c

Status
Not open for further replies.

Lftsk

Programmer
Jul 11, 2002
25
US
Hello all,

I hope someone here can help me.

Here's my problem

I have 2 Databases. One in MySQL and another in SQL Server. I am trying to link the MySQL Server into SQL Server using the MySQL ODBC driver 3.51. It appears to do so successfully until I try to run a query on any table in the MySQL Database. An error seems to occur on a datatype conversion. Specifically an error occurs on the char datatype and it says it's returning a different length.

"returned an unexpected data length for the fixed-length column '[MSDASQL].appt_phone'. The expected data length is 12, while the returned data length is 8."

I'm not quite sure where to go from here.

Any help would be greatly appreciated.

Thank you.
 
I'm not positive this will work, but what I would try is
to make the fields the same length (12):

alter table yourmysqltable modify appt_phone char(12);
 
Unfortunately I can't. The length of the field in the MySQL database is fixed and can't be changed. And I'm not even defining the length in the MS SQL database. It's just a Select statement.

SELECT *
FROM OPENQUERY(DataMiner, 'SELECT addr_zip FROM tblProviders')

Do you know of any problem with this driver?
 
Uh, somebody defined the length of the column.
You can see the length of the column by doing either
a 'DESCRIBE yourtable' or 'SHOW CREATE TABLE yourtable'.

I can see you aren't defining the field length in your SELECT
statement.

I'm not aware of problems in the 3.51 driver.

You cannot do even simple numerical queries?
SELECT * FROM OPENQUERY(DataMiner,
'SELECT somenumber FROM sometable')

You may want to take a look at

Sorry, out of ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top