Results 1 to 2 of 2

Thread: Selecting data

  1. #1
    Sidca Guest

    Selecting data

    Hello .
    Sometimes when i try to select data from a table (from a selected database)
    using SQL Query Analyzer (for exemple) i receive an error message : "The Object XX does not exist" . But when i prefix it by the Owner it work .

    What is the problem then ?



  2. #2
    Martyn Hodgson Guest

    Selecting data (reply)

    By default SQL Server (and pretty well any other DB) requires that you fully qualify object names. That is usually a 3 or 4 part object name. However, because this would be very slow to type, if you leave out parts of an object name the database substitutes default values for the missing parts. In SQL Server the four part name for an object is;

    Linked server name - defaults to null, so we use the local SQL Server instance
    Catalog - this is the database name, you've selected a database in Query Analyser so this sets this value.
    Schema - this is the object owner. By default this is the user that you connected to the database with.
    Object name - the table name.

    Thus, if you want to reference an object not created by the user you connected with, you have to (at least) specify the objects owner.

    Of course, you can create an alias to the object, to get around this.

    Martyn
    martyn.hodgson@cdesolutions.com


    ------------
    Sidca at 8/21/01 2:58:25 PM

    Hello .
    Sometimes when i try to select data from a table (from a selected database)
    using SQL Query Analyzer (for exemple) i receive an error message : "The Object XX does not exist" . But when i prefix it by the Owner it work .

    What is the problem then ?



Posting Permissions

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