views:

47

answers:

0

I am trying to set up a third party MySQL as a Linked Server on SQL Server 2008. When I try to access the data via a simple OpenQuery below I get an error.

SELECT * FROM OpenQuery(SERVERNAME, 'SELECT * FROM table')

The error message:

OLE DB provider 'MSDASQL' for linked server 'SERVERNAME' returned data that does not match expected data length for column '[MSDASQL].tablename'. The (maximum) expected data length is X, while the returned data length is Y.

NOTE:(where X > Y)

I've tried with another MySQL table that I built myself and it works fine. Therefore I assume the problem might be with the MySQL source.

EDIT: After digging a little deeper into the MySQL data I found several "invalid" dates such as zero dates. These could be a reason, however I have no way to change the data source so I must find a way to convince SQL to ignore it.

I recall something form previous versions of SQL where you could switch to "Lazy Schema Validation" to force SQL not to check this. However this option appears to be gone in 2008.

Any ideas how I could make this work?