Solved

New to MySQL and getting an error on OpenSource SQL query from SQL 2000

Posted on 2008-06-20
7
629 Views
Last Modified: 2012-08-13
Experts:

This SQL Server 2005 script:

select * from openquery (MYREMOTEMYSQLSERVER,
'select clientid, client_status_dt from client')


Gives me this error:

OLE DB error trace [Non-interface error:  Column 'client_status_dt' (compile-time ordinal 2) of object 'select clientid, client_status_dt from client' was reported to have a DBCOLUMNFLAGS_ISNULLABLE of 0 at compile time and 32 at run time].
Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'OleMySql.MySqlSource.1' supplied inconsistent metadata for a column. Metadata information was changed at execution time.

When I select certain columns such as CLIENTID which is NEVER NULL...then I get the column of data, however if I request data from a column that contains NULLS...I get the above error.

What can I do to prevent the error and get my data?

I'm using MS SQL Server 2005 on SQL 2000 DBs accessing....MySQL on a UNUNTU LINUX box. I do have access to the LINUX server using MySQL SQL Browser,...however I was just trying to see if I can get data returned from my MS SQL SERVER Management Studio program.

thanks
M
0
Comment
Question by:MIKE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 4

Expert Comment

by:zx10r
ID: 21832560
check this thread out http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_20856262.html

Also, make sure you are using the latest OLE DB driver for MySQL
0
 
LVL 17

Author Comment

by:MIKE
ID: 21832655
How...where...can I get the latest OLE DB driver for MySQL..?
0
 
LVL 4

Expert Comment

by:zx10r
ID: 21832763
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 17

Author Comment

by:MIKE
ID: 21832860
Isn't there a way to tell the query to place a blank or a ZERO or something in the field...IF...the field is NULL..??

In SQL Server it is this:

isnull({fieldname},0)

What is this in MySQL...?
0
 
LVL 4

Accepted Solution

by:
zx10r earned 500 total points
ID: 21832954
use COALSCE

COALESCE(test, 'test is null')
0
 
LVL 17

Author Closing Comment

by:MIKE
ID: 31469211
amazing...Coalesce works totally different in SQL Server...but this worked fine in MySQL...
0
 
LVL 4

Expert Comment

by:zx10r
ID: 21833169
I know, funny how that works.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

731 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