Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    Hong Kong
    Posts
    25

    Unanswered: How to query table w/o specifying the table owner?

    I am using Sybase ASE 12.5. I have a database owned by a certain user account, say owner1. So, when other user accounts query those tables, I have to specify the schema name, like "owner1.table1".

    Can I create alias for those tables, so that I don't have to specify the schema name? I searched on Internet with keywords "sybase", "alias", "synonym" but found nothing.

    Or else, can I set other users to use "owner1" as their default schema? I also searched this but again couldn't find anything.....
    Last edited by Lapson; 12-07-07 at 05:40. Reason: change title

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Quote Originally Posted by Lapson
    can I set other users to use "owner1" as their default schema?
    exec sp_addalias otheruser, owner1
    But this will also allow otheruser to modify owner1.table1

  3. #3
    Join Date
    May 2003
    Location
    Hong Kong
    Posts
    25
    Quote Originally Posted by pdreyer
    exec sp_addalias otheruser, owner1
    But this will also allow otheruser to modify owner1.table1
    Yes, that's the problem. I want other users to be "read-only".

  4. #4
    Join Date
    Jul 2006
    Posts
    13
    Is it a must to specify schema name? In my case, I also have some databases owned by other account, and the read-only accounts can query the tables in the database without specifying the schema name.

    From my understanding, the full syntax to access a table is <database>.<owner>.<table>. But if you specify the table name only, it equal to <current_database>.dbo.<table>.

  5. #5
    Join Date
    May 2003
    Location
    Hong Kong
    Posts
    25
    Quote Originally Posted by bonson
    Is it a must to specify schema name? In my case, I also have some databases owned by other account, and the read-only accounts can query the tables in the database without specifying the schema name.

    From my understanding, the full syntax to access a table is <database>.<owner>.<table>. But if you specify the table name only, it equal to <current_database>.dbo.<table>.
    Yes, if table owner is dbo, then it's ok to omit the owner name.

    But my tables are not owned by dbo, they are owned by owner1. So when other users try to query, the owner name must be specified, like "owner1.table1".

Posting Permissions

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