Link to home
Start Free TrialLog in
Avatar of BrianFord
BrianFordFlag for United States of America

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:
execute ('select * from agentactivity') at linked_db

Open in new window


However, when I execute this one:
execute ('select * from call') at linked_db

Open in new window


I get the error:

OLE DB provider "MSDASQL" for linked server "shoretel" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.0.52-enterprise-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?
ASKER CERTIFIED SOLUTION
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BrianFord

ASKER

Thanks sammy,

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
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.