Results 1 to 4 of 4

Thread: SQL (SQL 2000)

  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL (SQL 2000)

    while this question is not exactly Access problem, but it is close enough, I guess.

    In SQL Server 2000, I have the following sql statement for the NorthWind database

    SELECT OrderID, ProductID, UnitPrice, Quantity, UnitPrice * Quantity AS Amt
    FROM dbo.[Order Details]

    This statement works fine in the Enterprise manager's Views but not in the Query Analyzer. The error msg is

    Server: Msg 208, Level 16, State 1, Line 1
    Invalid object name 'dbo.Order Details'.

    But I have already used [ ] to enclose the table name Order Details. Does anyone have any idea?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SQL (SQL 2000)

    Did you select the correct database in QA? It's easy to wind up in Master or some other database there instead of the one you intended.

    PS/ It's fine to post SQL Server questions here in Access since we don't really have a SQL Server forum. The database junkies tend to hand out here. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Charlotte

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: SQL (SQL 2000)

    Analyzer doesn't like field or table names with spaces in them - Enterprise manager plays some tricks with the space in the table name to get it to work.
    Wendell

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL (SQL 2000)

    Charlotte,

    You are right on that. I forgot to pick the right database. In SQL2000, you have the left hand pane that allow you to see the databases and tables but your drag and drop will not help you to pick the table at all. It stays as Master.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •