Results 1 to 4 of 4

Thread: Table Owner

  1. #1
    Join Date
    Jan 2003
    Location
    nada
    Posts
    10

    Unanswered: Table Owner

    Hi,

    I've a database table named MYTABLE
    It's owner is T01.

    Now when I log on as MA I want to do a select like this:

    select * from MYTABLE -- Gives me an error.
    Select * from T01.MYTABLE -- goes fine..

    I really don't want to specify the owner for every table. All tables have the owner T01.

    Is it possible to use some statement before executing my sql statement.
    Something like this :-=

    Use owner T01
    select * from MYTABLE.

    Is it possible ?

    //Martin
    martin508

  2. #2
    Join Date
    Jun 2003
    Posts
    269

    Thumbs up Re

    it is not possible.
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

  3. #3
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    all that can be done is

    (a) ask T01 to prefix all tables/sps etc created by him with "dbo." provided he has enough rights for this

    (b) or change all objects created by T01 to dbo using sp_changeobjectowner. this needs extra care as u may break the object relations in doing so.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Or you can "cheat" and create views owned by dbo that reference the tables owned by T01. It is a pain in the patoot, but I've done it for several poorly written propriatary systems.

    -PatP

Posting Permissions

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