SQL Server 2005 Query to Linked MySQL Objects to USER

  • I have a MySQL database linked to a SQL Server 2005 database. Everything seems to work fine until I include USER in a query. I have modeled the queries in the MySQL workbench and they work fine. In all cases, USER is qualified (e.g. table.USER) or LinkedServerName...USER as I have both columns and a table named USER).

    In all cases the error is invalid syntax near USER. Queries as simple as select * from LINKEDNAME...USER fail.

    All names in MySQL are upper case and I have confirmed that it is not a case sensitivity issue.

    I know, this sounds very weird, so any ideas would be most welcome.

    TIA

    John

  • John USER is a keyword in SQL, can you try wrapping the tablename in brackets or double quotes?

    select * from LINKEDNAME...

    select * from LINKEDNAME..."USER"

    does it work that way?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thank you, yes. Just before I saw your reply, the brain fog cleared and I came to the same conclusion.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply