Having trouble with SELECT

  • Select * from "table_name"

    I'm trying to select everything from a user table, but continues to give me an error.

    But when I select everything from a system table, it works...

    Why?

  • Remove quotes around the tablename (unless you want to start messing with the quoted identifiers)

    Does the table exist?

    What's its real name?

  • Yeah, sorry... I'm not using quotes...

    This is the error message I get:

    Server: Msg 208, Level 16, State 1, Line 1

    Invalid object name 'ARM11'.

  • check the owner of the table

     


    Kindest Regards,

    Amit Lohia

  • select * from ARM11

  • If you're sure that the table exists then try this :

    Select * from YourUserName.TableName

    to find your username :

    Select USER_NAME()

  • I figured it out... Needed the database name + .dbo.ARM11

  • IF in QA >>

    USE CorrectDatabaseName

    or in the connection string of the application, you can specify the correct database with the option catalog (IIRC).

    Check out http://www.ConnectionStrings.com

  • or

    if your in query analzyer, select the database your working in on the top of the app.

    Or in query analyzer

    use Mydatabasename

    Select *

    from mytable

Viewing 9 posts - 1 through 8 (of 8 total)

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