Cannot select tables with . in the name

AlexWileyAlexWiley Member Posts: 230
edited 2009-10-09 in SQL General
I haven't had this issue until this client, and I searched and found nothing. Probably a rookie SQL mistake.

I get a syntax error when trying to select records that have a period in the name, even when I drag and drop from the SMSE explorer. It says there is a syntax error around *last word in table name*. So if I try to select the Cust. Ledger Entry table it says "Incorrect syntax around 'Entry'". This is really frustrating because I know it is something simple.

Answers

  • bbrownbbrown Member Posts: 3,268
    Are you delimiting the table names?

    Select Field1, Field2 from [dbo].[Your Company$Cust_ Ledger Entry]
    There are no bugs - only undocumented features.
  • AlexWileyAlexWiley Member Posts: 230
    Yes, the exact query line is:
    select * from dbo.Company$Cust_ Ledger Entry
    
  • bbrownbbrown Member Posts: 3,268
    AlexWiley wrote:
    Yes, the exact query line is:
    select * from dbo.Company$Cust_ Ledger Entry
    

    If that is your exact query, then the answer to my question is No.
    There are no bugs - only undocumented features.
  • AlexWileyAlexWiley Member Posts: 230
    Uhg, sorry about that, I missed the point the first time. It pulls fine now- I responded too quickly because I was putting the entire line in brackets (select * from [dbo.Company$Cust_ Ledger Entry]). Thank you bbrown!!
  • bbrownbbrown Member Posts: 3,268
    No problem. It's a very common mistake. Glad to hear it's working now.
    There are no bugs - only undocumented features.
Sign In or Register to comment.