BrianFord
asked on
TRying to query MySQl from SQl Server
I am using SQL Server 2008 and I have a linked server to a MySQL database (linked_db)
When I execute the following statement I get data returned without a problem:
However, when I execute this one:
I get the error:
OLE DB provider "MSDASQL" for linked server "shoretel" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.0.52-ente rprise-nt] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call' at line 1".
Any idea's?
When I execute the following statement I get data returned without a problem:
execute ('select * from agentactivity') at linked_db
However, when I execute this one:
execute ('select * from call') at linked_db
I get the error:
OLE DB provider "MSDASQL" for linked server "shoretel" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.0.52-ente
Any idea's?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yes, that's what I had in mind. I just didn't come up with the correct name which is back-ticks.
Thanks for the points and grade.
Thanks for the points and grade.
ASKER
I tried that but still got the same error, then I tried running the statemen in SQLyog and got the same error, so......the trick was in the character used for quoting
It needs be an ` (a sort of backwards apostrophe) and not a normal ' (apostrophe)
thanks