Marcus Aurelius
asked on
New to MySQL and getting an error on OpenSource SQL query from SQL 2000
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
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
ASKER
How...where...can I get the latest OLE DB driver for MySQL..?
ASKER
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...?
In SQL Server it is this:
isnull({fieldname},0)
What is this in MySQL...?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
amazing...Coalesce works totally different in SQL Server...but this worked fine in MySQL...
I know, funny how that works.
Also, make sure you are using the latest OLE DB driver for MySQL