Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Microsoft Query Editor error when adding table called User

$
0
0

I have an Excel 2010 report using an ODBC connection. I am editing my query with MS query editor, adding the tables in with the GUI.

I have a table 'Action' with 'UserId' joined to my table 'User'.

When I add the User table, I instantly get an error "Incorrect syntax near the keyword'User'. Statement(s) could not be prepared.

Now I am aware this will be to due with the use of the name 'User' as when I query my user table I usually have to type [User]. But as I am using the editor, I don't understand why it can't handle this. I am not too experienced with SQL, so for these excel reports I need to use the GUI.

If I change the table name to 'Staff' this sorts the problem. This is really not an option I'd like to consider as it would involve a lot of updating code in my C# application.

Is there anything I can do to resolve this using the GUI...


Viewing all articles
Browse latest Browse all 4871

Trending Articles