Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem querying MySQL Database from a MSSQL Linked Server

Posted on 2011-04-19
Medium Priority
Last Modified: 2012-05-11
I'm trying to query a MySQL database via a SQL2008 linked server and am getting the following error:

OLE DB provider "MSDASQL" for linked server "DENEB" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.0.26]MySQL client ran out of memory".
Msg 7320, Level 16, State 2, Line 1
Cannot execute the query "SELECT * FROM sitescape.SS_ChangeLogs" against OLE DB provider "MSDASQL" for linked server "DENEB".

My query is as follows:

I can successfully query ANY individual columns from the MySQL source table above with the exception of one which is defined in the MySQL table as a "longtext". This is probably similar to MSSQL's "ntext" or "text".

Even querying just the longtext column alone generates the error.

I need to be able to query the table in it's entirety in effort to bring the MySQL table into a SQL Server equivalent. Any ideas of what I can do to beat/circumvent the error?

The MySQL source table is about 150k rows and sits on a separate server than the MSSQL server I'm querying from.

Thanks much,

Question by:glo-dba
  • 2
  • 2
LVL 16

Assisted Solution

by:Walter Ritzel
Walter Ritzel earned 750 total points
ID: 35426264
You should list in your select statement all the columns of that table, instead of using the *

Author Comment

ID: 35426444
When I reference the binary column directiy in the select statement the same error occurs.
LVL 16

Accepted Solution

Walter Ritzel earned 750 total points
ID: 35426471
Yes, I forgot to mention. You probably dont have how to bring the binary column in a standard select. I would say that for this specific field, you should create some code that will dump the information from this field directly from MySQL into a folder (assuming the content is a file or something like that), and then reload into mssql.

Again, this is my experience. Maybe someone has other idea.

Author Closing Comment

ID: 36429763
Ultimately casting the binary into a varchar(max) got me around the problem.

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question